+require 'audit_logs'
+
class Log < ArvadosModel
include HasUuid
include KindAndEtag
include CommonApiTemplate
serialize :properties, Hash
before_validation :set_default_event_at
- attr_accessor :object, :object_kind
after_save :send_notify
+ after_commit { AuditLogs.tidy_in_background }
api_accessible :user, extend: :common do |t|
t.add :id
self.event_at = thing.created_at
when "update"
self.event_at = thing.modified_at
- when "destroy"
+ when "delete"
self.event_at = db_current_time
end
self
def send_notify
connection.execute "NOTIFY logs, '#{self.id}'"
end
-
end