Files
fizzy/app/models/message.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

8 lines
239 B
Ruby

class Message < ApplicationRecord
belongs_to :card, touch: true
delegated_type :messageable, types: Messageable::TYPES, inverse_of: :message, dependent: :destroy
scope :chronologically, -> { order created_at: :asc, id: :desc }
end