X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eae48c31bb338689ec67fbc6a14a2e0b1fb5e3b6..efcfd2cdc9a9ed6ab3af54e9a4e149d4bdf1f8d3:/services/api/app/models/log.rb diff --git a/services/api/app/models/log.rb b/services/api/app/models/log.rb index 7eab402609..44984255f8 100644 --- a/services/api/app/models/log.rb +++ b/services/api/app/models/log.rb @@ -1,11 +1,13 @@ +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 @@ -100,7 +102,6 @@ class Log < ArvadosModel end def send_notify - connection.execute "NOTIFY logs, '#{self.id}'" + ActiveRecord::Base.connection.execute "NOTIFY logs, '#{self.id}'" end - end