|
|
|
@@ -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 |
|
|
|
|