Files
fizzy/app/models/mention.rb
T
Jorge Manrubia 8aa99e34b4 Persist notification's creator
Instead of delegating. With a polymorphic relationship, relying on a certain
attribute implies doing things like aliasing "mentioner" to "creator" or similar.
2025-04-22 13:48:43 +02:00

8 lines
214 B
Ruby

class Mention < ApplicationRecord
include Notifiable
belongs_to :container, polymorphic: true
belongs_to :mentioner, class_name: "User"
belongs_to :mentionee, class_name: "User", inverse_of: :mentions
end