Sha256: c4541d351e61a5fd166929b9c6f80fb87d65e2bddf5e2c4607cd26c1c463c610
Contents?: true
Size: 1.46 KB
Versions: 18
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
18 entries across 18 versions & 1 rubygems