6f1c802292
We are not using/displaying model validations anywhere
11 lines
300 B
Ruby
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
|