Files
fizzy/app/models/concerns/messageable.rb
T
David Heinemeier Hansson e4efe446e6 Simlpe callback is actually enough
Since the Comment already knows about the card.
2025-04-12 11:45:34 +02:00

11 lines
224 B
Ruby

module Messageable
extend ActiveSupport::Concern
TYPES = %w[ Comment EventSummary ]
included do
has_one :message, as: :messageable, touch: true, dependent: :destroy
has_one :card, through: :message
end
end