Method: StandardModel#save_and_log
- Defined in:
- lib/app/models/concerns/standard_model.rb
#save_and_log(user, options = {}) ⇒ Object
Record a save
274 275 276 277 278 279 280 281 282 |
# File 'lib/app/models/concerns/standard_model.rb', line 274 def save_and_log(user, = {}) self.created_by = user if new_record? self.last_modified_by = user model_changes = changes action = audit_action result = save() log_change(user, model_changes, action) if valid? result end |