Sha256: ab216e83d9873e21d2c76f709a1abc0fb4e9c339a08d1ec39c3e8b5d7b53ab96

Contents?: true

Size: 462 Bytes

Versions: 6

Compression:

Stored size: 462 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Comments
    class CommentVotedEvent < Decidim::Events::SimpleEvent
      include Decidim::Comments::CommentEvent

      i18n_attributes :upvotes
      i18n_attributes :downvotes

      def upvotes
        extra[:upvotes]
      end

      def downvotes
        extra[:downvotes]
      end

      private

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-comments-0.24.3 app/events/decidim/comments/comment_voted_event.rb
decidim-comments-0.24.2 app/events/decidim/comments/comment_voted_event.rb
decidim-comments-0.24.1 app/events/decidim/comments/comment_voted_event.rb
decidim-comments-0.24.0 app/events/decidim/comments/comment_voted_event.rb
decidim-comments-0.24.0.rc2 app/events/decidim/comments/comment_voted_event.rb
decidim-comments-0.24.0.rc1 app/events/decidim/comments/comment_voted_event.rb