Class: Decidim::Meetings::Questionnaire
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Meetings::Questionnaire
- Includes:
- Traceable
- Defined in:
- app/models/decidim/meetings/questionnaire.rb
Overview
The data store for a Questionnaire in the Decidim::Meetings component.
Class Method Summary collapse
Instance Method Summary collapse
- #all_questions_unpublished? ⇒ Boolean
-
#questions_editable? ⇒ Boolean
Public: returns whether the questionnaire questions can be modified or not.
Class Method Details
.log_presenter_class_for(_log) ⇒ Object
24 25 26 |
# File 'app/models/decidim/meetings/questionnaire.rb', line 24 def self.log_presenter_class_for(_log) Decidim::Meetings::AdminLog::QuestionnairePresenter end |
Instance Method Details
#all_questions_unpublished? ⇒ Boolean
20 21 22 |
# File 'app/models/decidim/meetings/questionnaire.rb', line 20 def all_questions_unpublished? questions.all?(&:unpublished?) end |
#questions_editable? ⇒ Boolean
Public: returns whether the questionnaire questions can be modified or not.
15 16 17 18 |
# File 'app/models/decidim/meetings/questionnaire.rb', line 15 def questions_editable? has_component = questionnaire_for.meeting.respond_to? :component (has_component && !questionnaire_for.meeting.component.published?) || answers.empty? end |