Browse Source

操作记录记录用户信息

pull/347/head
xxq250 1 year ago
parent
commit
19cf675f2e
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      app/models/user_action.rb

+ 4
- 1
app/models/user_action.rb View File

@@ -66,9 +66,12 @@ class UserAction < ApplicationRecord
def build_mode(model_name)
model = model_name.constantize.new
model_name.constantize.column_names.each do |col|
model[col] = self.data_bank[col]
data = self.data_bank.class == String ? JSON.parse(self.data_bank) : self.data_bank
model[col] = data[col]
end
model
rescue =>err
return nil
end

private


Loading…
Cancel
Save