Class: Decidim::Accountability::BaseResultEvent
- Inherits:
-
Events::SimpleEvent
- Object
- Events::SimpleEvent
- Decidim::Accountability::BaseResultEvent
show all
- Defined in:
- app/events/decidim/accountability/base_result_event.rb
Instance Method Summary
collapse
Instance Method Details
#hidden_resource? ⇒ 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
|
#proposal ⇒ Object
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: [:proposal_id])
end
|
#proposal_path ⇒ Object
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_title ⇒ Object
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_text ⇒ Object
8
9
10
|
# File 'app/events/decidim/accountability/base_result_event.rb', line 8
def resource_text
translated_attribute(resource.description)
end
|