Class: Decidim::Amendable::AmendmentBaseEvent
- Inherits:
-
Events::SimpleEvent
- Object
- Events::BaseEvent
- Events::SimpleEvent
- Decidim::Amendable::AmendmentBaseEvent
- Defined in:
- app/events/decidim/amendable/amendment_base_event.rb
Direct Known Subclasses
AmendmentAcceptedEvent, AmendmentCreatedEvent, AmendmentRejectedEvent, EmendationPromotedEvent
Instance Method Summary collapse
- #amendable_path ⇒ Object
- #amendable_title ⇒ Object
- #amendable_type ⇒ Object
- #emendation_author ⇒ Object
- #emendation_author_nickname ⇒ Object
- #emendation_author_path ⇒ Object
- #emendation_path ⇒ Object
Methods inherited from Events::SimpleEvent
#email_intro, #email_outro, #email_subject, #event_has_roles?, i18n_attributes, #i18n_options, #i18n_scope, #notification_title, #participatory_space_url, #resource_path, #resource_text, #resource_url
Methods included from OrganizationHelper
#current_organization_name, #organization_colors, #organization_description_label, #organization_name
Methods included from TranslatableAttributes
Methods included from ComponentPathHelper
#can_be_managed?, #main_component_path, #main_component_url, #manage_component_path
Methods inherited from Events::BaseEvent
#action_cell, #action_data, #content_in_same_language?, #hidden_resource?, #initialize, #organization, #perform_translation?, #resource_locator, #resource_path, #resource_text, #resource_title, #resource_url, #safe_resource_text, #safe_resource_translated_text, #translation_missing?, type
Methods included from SanitizeHelper
#decidim_escape_translated, #decidim_html_escape, #decidim_sanitize, #decidim_sanitize_admin, #decidim_sanitize_editor, #decidim_sanitize_editor_admin, #decidim_sanitize_newsletter, #decidim_sanitize_translated, #decidim_url_escape, included
Constructor Details
This class inherits a constructor from Decidim::Events::BaseEvent
Instance Method Details
#amendable_path ⇒ Object
16 17 18 |
# File 'app/events/decidim/amendable/amendment_base_event.rb', line 16 def amendable_path @amendable_path ||= Decidim::ResourceLocatorPresenter.new(amendable_resource).path end |
#amendable_title ⇒ Object
8 9 10 |
# File 'app/events/decidim/amendable/amendment_base_event.rb', line 8 def amendable_title @amendable_title ||= translated_attribute(amendable_resource.title) end |
#amendable_type ⇒ Object
12 13 14 |
# File 'app/events/decidim/amendable/amendment_base_event.rb', line 12 def amendable_type @amendable_type ||= amendable_resource.class.model_name.human.downcase end |
#emendation_author ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/events/decidim/amendable/amendment_base_event.rb', line 20 def return unless emendation_resource @emendation_author ||= if emendation_resource.is_a?(Decidim::Coauthorable) Decidim::UserPresenter.new(emendation_resource.) else Decidim::UserPresenter.new(emendation_resource.) end end |
#emendation_author_nickname ⇒ Object
30 31 32 33 34 |
# File 'app/events/decidim/amendable/amendment_base_event.rb', line 30 def return unless emendation_resource @emendation_author_nickname ||= .nickname end |
#emendation_author_path ⇒ Object
36 37 38 39 40 |
# File 'app/events/decidim/amendable/amendment_base_event.rb', line 36 def return unless emendation_resource @emendation_author_path ||= .profile_path end |
#emendation_path ⇒ Object
42 43 44 45 46 |
# File 'app/events/decidim/amendable/amendment_base_event.rb', line 42 def emendation_path return unless emendation_resource @emendation_path ||= Decidim::ResourceLocatorPresenter.new(emendation_resource).path end |