Skip to content

Commit

Permalink
audit
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Nov 30, 2023
1 parent 499d70b commit 14c9eb6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/work-design/rails_com.git
revision: 812e1cad5b9864947f7ccf7a02248670fc91b068
revision: 48dc213af87f1f5e5627ee1bee6206d5cf405d1a
specs:
rails_com (1.3.0)
acme-client
Expand All @@ -18,14 +18,14 @@ GIT

GIT
remote: https://github.com/work-design/rails_design.git
revision: 325fbdffd6b43820039ebab4da8dd60fea568187
revision: e1a2ab2314a882985e48502648af4d5aed2244eb
specs:
rails_design (0.0.1)
rails

GIT
remote: https://github.com/work-design/rails_extend.git
revision: 075daf9b8da63a99cfcea45f91eb51e2cf3276b2
revision: e8f39cb7529b55cda4eb8b5e4d69fb63ec998168
specs:
rails_extend (1.0.1)
rails (>= 5.0)
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/auditor/controller/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Auditor
module Controller::Application

# after_action
def mark_audits(instance: [], local: [], binding:, **options)
def mark_audits(instance: [], local: [], bind: binding, **options)
instance_records = Array(instance).map!(&:to_sym) & valid_ivars
instance_records.each do |ivar|
record = instance_variable_get(ivar)
Expand All @@ -12,7 +12,7 @@ def mark_audits(instance: [], local: [], binding:, **options)

local_records = Array(local).map!(&:to_sym) & local_variables
local_records.each do |ivar|
record = binding.local_variable_get(ivar)
record = bind.local_variable_get(ivar)
next unless record.is_a?(ActiveRecord::Base)
save_audits(record, **options)
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/auditor/ext/audited.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def save_audits(operator:, only: [], except: [], include: [], **extra_options)

audit.operator_type = operator.class.name
audit.operator_id = operator.id
audit.assign_attributes = extra_options.except!(:note, :controller_path, :action_name, :remote_ip)
audit.assign_attributes extra_options.except!(:note, :controller_path, :action_name, :remote_ip)
audit.extra = extra_options
audit.save
end
Expand Down

0 comments on commit 14c9eb6

Please sign in to comment.