notebook/app/models/events/content_change_event.rb
2019-05-03 20:22:32 -05:00

14 lines
235 B
Ruby

class ContentChangeEvent < ApplicationRecord
belongs_to :user
serialize :changed_fields, Hash
def content
content_type.constantize.find_by(id: content_id)
end
def entity
content.try(:entity) || content
end
end