Sha256: ea16ca35e1ec3e73bb7acce1995bff68b71a74ba2b16f38efd8109ec7c2f9f9a

Contents?: true

Size: 605 Bytes

Versions: 45

Compression:

Stored size: 605 Bytes

Contents

# frozen-string_literal: true

module Decidim
  module Proposals
    class CollaborativeDraftWithdrawnEvent < Decidim::Events::SimpleEvent
      i18n_attributes :author_nickname, :author_name, :author_path

      delegate :nickname, :name, to: :author, prefix: true

      def nickname
        author_nickname
      end

      def author_path
        author.profile_path
      end

      private

      def author
        @author ||= Decidim::UserPresenter.new(author_user)
      end

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

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
decidim-proposals-0.26.1 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.26.0 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.26.0.rc2 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.26.0.rc1 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.25.2 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.25.1 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.25.0 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.25.0.rc4 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.25.0.rc3 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.25.0.rc2 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.25.0.rc1 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.24.3 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.23.6 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.24.2 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.23.5 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.24.1 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.24.0 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.24.0.rc2 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.23.4 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb
decidim-proposals-0.24.0.rc1 app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb