Class: Effective::Response
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::Response
- Defined in:
- app/models/effective/response.rb
Instance Method Summary collapse
Instance Method Details
#category_partial ⇒ Object
77 78 79 |
# File 'app/models/effective/response.rb', line 77 def category_partial question&.category_partial end |
#completed? ⇒ Boolean
81 82 83 84 |
# File 'app/models/effective/response.rb', line 81 def completed? return false if responsable.blank? responsable.completed? end |
#response ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'app/models/effective/response.rb', line 60 def response return nil unless question.present? return date if question.date? return email if question.email? return number if question.number? return long_answer if question.long_answer? return short_answer if question.short_answer? return upload_file if question.upload_file? return .first if question.choose_one? return .first if question.select_up_to_1? return if question.question_option? raise('unknown response for unexpected question category') end |
#to_s ⇒ Object
55 56 57 58 |
# File 'app/models/effective/response.rb', line 55 def to_s #model_name.human response.to_s end |