操作记录记录用户信息

This commit is contained in:
2024-09-27 10:42:03 +08:00
parent 3fae388d92
commit 19cf675f2e

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