ae497aae85
Buckets destroy their bubbles, which destroy their thread entries, which destroy their threadables, which is how comments end up destroyed, and then rollups end up deleting their events
15 lines
352 B
Ruby
15 lines
352 B
Ruby
module Bubble::Eventable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
has_many :events
|
|
|
|
after_create -> { track_event :created }
|
|
end
|
|
|
|
private
|
|
def track_event(action, creator: Current.user, **particulars)
|
|
events.create! action: action, creator: creator, particulars: { creator_name: creator.name }.merge(particulars)
|
|
end
|
|
end
|