Class: Decidim::Proposals::ProposalStateChangedEvent

Inherits:
Events::SimpleEvent
  • Object
show all
Includes:
Events::AuthorEvent
Defined in:
app/events/decidim/proposals/proposal_state_changed_event.rb

Instance Method Summary collapse

Instance Method Details

#default_i18n_optionsObject



24
25
26
# File 'app/events/decidim/proposals/proposal_state_changed_event.rb', line 24

def default_i18n_options
  super.merge({ state: })
end

#event_has_roles?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/events/decidim/proposals/proposal_state_changed_event.rb', line 20

def event_has_roles?
  true
end

#resource_textObject



16
17
18
# File 'app/events/decidim/proposals/proposal_state_changed_event.rb', line 16

def resource_text
  translated_attribute(resource.answer)
end

#stateObject



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