Class: Decidim::Proposals::ProposalStateChangedEvent
- Inherits:
-
Events::SimpleEvent
- Object
- Events::SimpleEvent
- Decidim::Proposals::ProposalStateChangedEvent
- Includes:
- Events::AuthorEvent
- Defined in:
- app/events/decidim/proposals/proposal_state_changed_event.rb
Instance Method Summary collapse
Instance Method Details
#default_i18n_options ⇒ Object
24 25 26 |
# File 'app/events/decidim/proposals/proposal_state_changed_event.rb', line 24 def super.merge({ state: }) end |
#event_has_roles? ⇒ Boolean
20 21 22 |
# File 'app/events/decidim/proposals/proposal_state_changed_event.rb', line 20 def event_has_roles? true end |
#resource_text ⇒ Object
16 17 18 |
# File 'app/events/decidim/proposals/proposal_state_changed_event.rb', line 16 def resource_text translated_attribute(resource.answer) end |
#state ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/events/decidim/proposals/proposal_state_changed_event.rb', line 28 def state if resource.emendation? humanize_proposal_state(model.state) else translated_attribute(resource.proposal_state&.title) end end |