Class: Decidim::Accountability::BaseResultEvent

Inherits:
Events::SimpleEvent
  • Object
show all
Defined in:
app/events/decidim/accountability/base_result_event.rb

Instance Method Summary collapse

Instance Method Details

#hidden_resource?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/events/decidim/accountability/base_result_event.rb', line 24

def hidden_resource?
  super || (proposal.respond_to?(:hidden?) && proposal.hidden?)
end

#proposalObject



20
21
22
# File 'app/events/decidim/accountability/base_result_event.rb', line 20

def proposal
  @proposal ||= resource.linked_resources(:proposals, "included_proposals").find_by(id: extra[:proposal_id])
end

#proposal_pathObject



16
17
18
# File 'app/events/decidim/accountability/base_result_event.rb', line 16

def proposal_path
  @proposal_path ||= Decidim::ResourceLocatorPresenter.new(proposal).path
end

#proposal_titleObject



12
13
14
# File 'app/events/decidim/accountability/base_result_event.rb', line 12

def proposal_title
  @proposal_title ||= decidim_sanitize_translated(proposal.title)
end

#resource_textObject



8
9
10
# File 'app/events/decidim/accountability/base_result_event.rb', line 8

def resource_text
  translated_attribute(resource.description)
end