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