Sha256: 2bc83f51cfb8c2f7485bdce2f1b8c2773f2b70e3b85a8c081f9dd911cec9fab4
Contents?: true
Size: 1.46 KB
Versions: 21
Compression:
Stored size: 1.46 KB
Contents
# frozen-string_literal: true module Decidim::Amendable class AmendmentBaseEvent < Decidim::Events::SimpleEvent i18n_attributes :amendable_path, :amendable_type, :amendable_title, :emendation_path, :emendation_author_nickname, :emendation_author_path def amendable_title @amendable_title ||= translated_attribute(amendable_resource.title) end def amendable_type @amendable_type ||= amendable_resource.class.model_name.human.downcase end def amendable_path @amendable_path ||= Decidim::ResourceLocatorPresenter.new(amendable_resource).path end def emendation_author return unless emendation_resource @emendation_author ||= if emendation_resource.is_a?(Decidim::Coauthorable) Decidim::UserPresenter.new(emendation_resource.creator_author) else Decidim::UserPresenter.new(emendation_resource.author) end end def emendation_author_nickname return unless emendation_resource @emendation_author_nickname ||= emendation_author.nickname end def emendation_author_path return unless emendation_resource @emendation_author_path ||= emendation_author.profile_path end def emendation_path return unless emendation_resource @emendation_path ||= Decidim::ResourceLocatorPresenter.new(emendation_resource).path end end end
Version data entries
21 entries across 21 versions & 1 rubygems