Files
fizzy/app/models/reaction.rb
T
2025-02-19 10:16:31 -06:00

13 lines
334 B
Ruby

class Reaction < ApplicationRecord
belongs_to :comment, touch: true
belongs_to :reacter, class_name: "User", default: -> { Current.user }
scope :ordered, -> { order(:created_at) }
validates_presence_of :content
def all_emoji?
content.match? /\A(\p{Emoji_Presentation}|\p{Extended_Pictographic}|\uFE0F)+\z/u
end
end