Sha256: 872642b9202647016dc0c9b759ad780da0e919120477a4bbd6fd2f35b28045d9

Contents?: true

Size: 568 Bytes

Versions: 17

Compression:

Stored size: 568 Bytes

Contents

# frozen-string_literal: true

module Decidim
  module Comments
    class UserMentionedEvent < Decidim::Events::SimpleEvent
      include Decidim::Events::AuthorEvent

      delegate :author, to: :comment

      def resource_path
        resource_locator.path(url_params)
      end

      def resource_url
        resource_locator.url(url_params)
      end

      private

      def comment
        @comment ||= Decidim::Comments::Comment.find(extra[:comment_id])
      end

      def url_params
        { anchor: "comment_#{comment.id}" }
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
decidim-comments-0.15.2 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.15.1 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.15.0 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.14.4 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.14.3 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.14.2 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.14.1 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.13.1 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.12.2 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.13.0 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.12.1 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.13.0.pre1 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.12.0 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.11.2 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.12.0.pre app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.11.1 app/events/decidim/comments/user_mentioned_event.rb
decidim-comments-0.11.0.pre1 app/events/decidim/comments/user_mentioned_event.rb