Method: StandardModel#save_and_log
- Defined in:
- lib/app/models/concerns/standard_model.rb
#save_and_log(user, options = {}) ⇒ Object
Record a save
271 272 273 274 275 276 277 278 279 |
# File 'lib/app/models/concerns/standard_model.rb', line 271 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 |