Sha256: 49ebd24695e865284939ba0caad7a9747ec8c4e837101b8852798876b8ef4cc6

Contents?: true

Size: 650 Bytes

Versions: 29

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Accountability
    class ProposalLinkedEvent < Decidim::Events::SimpleEvent
      i18n_attributes :proposal_title, :proposal_path

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

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

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

      def resource_text
        translated_attribute(resource.description)
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
decidim-accountability-0.26.10 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.9 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.28.0 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.5 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.28.0.rc5 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.28.0.rc4 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.8 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.4 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.3 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.7 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.5 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.2 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.1 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.4 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.0 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.3 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.0.rc2 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.27.0.rc1 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.2 app/events/decidim/accountability/proposal_linked_event.rb
decidim-accountability-0.26.1 app/events/decidim/accountability/proposal_linked_event.rb