Files
fizzy/app/models/reaction.rb
T
David Heinemeier Hansson 6f1c802292 Content being required via UI and db constraint is enough
We are not using/displaying model validations anywhere
2025-04-11 18:28:23 +02:00

11 lines
300 B
Ruby

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