Sha256: 146c49c993cfeedf5dd9d19c60773ed47ca9f86cdadc20e97ef8d362bc28d731

Contents?: true

Size: 645 Bytes

Versions: 16

Compression:

Stored size: 645 Bytes

Contents

# frozen-string_literal: true

module Decidim
  module Plans
    class PlanAccessRequestEvent < Decidim::Events::SimpleEvent
      i18n_attributes :requester_name, :requester_path, :requester_nickname

      delegate :name, to: :requester, prefix: true

      delegate :nickname, to: :requester, prefix: true

      def requester_path
        requester.profile_path
      end

      private

      def requester
        @requester ||= Decidim::UserPresenter.new(rejected_requester_user)
      end

      def rejected_requester_user
        @rejected_requester_user ||= Decidim::User.find_by(id: extra[:requester_id])
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-plans-0.18.2 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.18.1 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.18.0 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.17.0 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.9 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.8 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.7 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.6 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.5 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.4 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.3 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.2 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.1 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.16.0 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.15.1 app/events/decidim/plans/plan_access_request_event.rb
decidim-plans-0.15.0 app/events/decidim/plans/plan_access_request_event.rb