Class: Decidim::Surveys::SurveyQuestion
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Surveys::SurveyQuestion
- Defined in:
- decidim-surveys/app/models/decidim/surveys/survey_question.rb
Overview
The data store for a SurveyQuestion in the Decidim::Surveys component.
Constant Summary collapse
- TYPES =
%w(short_answer long_answer single_option multiple_option).freeze
Instance Method Summary collapse
-
#answer_options ⇒ Object
Rectify can’t handle a hash when using the from_model method so the answer options must be converted to struct.
Instance Method Details
#answer_options ⇒ Object
Rectify can’t handle a hash when using the from_model method so the answer options must be converted to struct.
15 16 17 |
# File 'decidim-surveys/app/models/decidim/surveys/survey_question.rb', line 15 def self[:answer_options].map { |option| OpenStruct.new(option) } end |