Files
fizzy/app/models/concerns/threadable.rb
T
2024-10-24 17:48:32 -06:00

14 lines
340 B
Ruby

module Threadable
extend ActiveSupport::Concern
TYPES = %w[ Comment Event::Rollup ]
included do
has_one :thread_entry, as: :threadable, class_name: "Bubble::Thread::Entry"
after_create -> { create_thread_entry! thread: thread }
after_update -> { thread_entry.touch }
after_touch -> { thread_entry.touch }
end
end