Sha256: b4461aed54a992036e13242fe7a64456bdad01b3642cd91ce87cad56f6504951

Contents?: true

Size: 606 Bytes

Versions: 13

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    class ProposalMentionedEvent < Decidim::Events::SimpleEvent
      include Decidim::ApplicationHelper

      i18n_attributes :mentioned_proposal_title

      def safe_resource_translated_text
        resource_text
      end

      def perform_translation?
        false
      end

      private

      def mentioned_proposal_title
        present(mentioned_proposal).title
      end

      def mentioned_proposal
        @mentioned_proposal ||= Decidim::Proposals::Proposal.find(extra[:mentioned_proposal_id])
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-proposals-0.29.1 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.28.4 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.29.0 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.28.3 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.29.0.rc4 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.29.0.rc3 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.29.0.rc2 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.29.0.rc1 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.28.2 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.28.1 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.28.0 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.28.0.rc5 app/events/decidim/proposals/proposal_mentioned_event.rb
decidim-proposals-0.28.0.rc4 app/events/decidim/proposals/proposal_mentioned_event.rb