Method: StandardModel::ClassMethods#create_and_log!

Defined in:
lib/app/models/concerns/standard_model.rb

#create_and_log!(user, attributes) ⇒ Object

Record the creation with this user



112
113
114
115
116
117
118
119
# File 'lib/app/models/concerns/standard_model.rb', line 112

def create_and_log!(user, attributes)
  model = create!(attributes)
  model.last_modified_by = user
  model.created_by = user
  model.save!
  log_change(user, model, attributes)
  model
end