Method: ActiveRecord::Transactions#rolledback!

Defined in:
lib/active_record/transactions.rb

#rolledback!(force_restore_state: false, should_run_callbacks: true) ⇒ Object

Call the #after_rollback callbacks. The force_restore_state argument indicates if the record state should be rolled back to the beginning or just to the last savepoint.



329
330
331
332
333
334
335
336
337
# File 'lib/active_record/transactions.rb', line 329

def rolledback!(force_restore_state: false, should_run_callbacks: true) # :nodoc:
  if should_run_callbacks
    _run_rollback_callbacks
  end
ensure
  restore_transaction_record_state(force_restore_state)
  clear_transaction_record_state
  @_trigger_update_callback = @_trigger_destroy_callback = false if force_restore_state
end