0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/plugins/discourse-reactions/lib/discourse_reactions/post_extension.rb
Jarek Radosz 8baf4d5d4c
DEV: Enable Style/RedundantSelf rubocop rule (#40098)
(to be enabled in the shared config)
2026-05-19 19:27:45 +02:00

15 lines
535 B
Ruby
Vendored

# frozen_string_literal: true
module DiscourseReactions::PostExtension
attr_accessor :post_actions_with_reaction_users
def self.prepended(base)
base.has_many :reactions, class_name: "DiscourseReactions::Reaction"
base.has_many :reactions_user, class_name: "DiscourseReactions::ReactionUser"
base.attr_accessor :user_positively_reacted, :reaction_users_count, :precomputed_reactions
end
def emoji_reactions
@emoji_reactions ||= reactions.select { |reaction| Emoji.exists?(reaction.reaction_value) }
end
end