Files
fizzy/app/models/event.rb
T
Mike Dalessio ecbe040e3e Implement Notification#card
Models now know how to find their cards, rather than trying to
implement this logic in a view helper.
2025-05-21 16:30:18 -04:00

22 lines
423 B
Ruby

class Event < ApplicationRecord
include Notifiable, Particulars
belongs_to :collection
belongs_to :creator, class_name: "User"
belongs_to :eventable, polymorphic: true
scope :chronologically, -> { order created_at: :asc, id: :desc }
after_create -> { eventable.event_was_created(self) }
delegate :card, to: :eventable
def action
super.inquiry
end
def notifiable_target
eventable
end
end