Files
fizzy/app/models/event.rb
T
Jorge Manrubia 8bb7783215 Extract "prompt generation" logic to models for events, comments and cards
So that we can reuse in other scenarios
2025-07-24 16:48:03 +02:00

22 lines
435 B
Ruby

class Event < ApplicationRecord
include Notifiable, Particulars, Promptable
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