Module: ActiveRecord::ConnectionAdapters::Savepoints

Included in:
AbstractAdapter
Defined in:
lib/active_record/connection_adapters/abstract/savepoints.rb

Overview

Active Record Connection Adapters Savepoints

Instance Method Summary collapse

Instance Method Details

#create_savepoint(name = current_savepoint_name) ⇒ Object



11
12
13
# File 'lib/active_record/connection_adapters/abstract/savepoints.rb', line 11

def create_savepoint(name = current_savepoint_name)
  internal_execute("SAVEPOINT #{name}", "TRANSACTION")
end

#current_savepoint_nameObject



7
8
9
# File 'lib/active_record/connection_adapters/abstract/savepoints.rb', line 7

def current_savepoint_name
  current_transaction.savepoint_name
end

#exec_rollback_to_savepoint(name = current_savepoint_name) ⇒ Object



15
16
17
# File 'lib/active_record/connection_adapters/abstract/savepoints.rb', line 15

def exec_rollback_to_savepoint(name = current_savepoint_name)
  internal_execute("ROLLBACK TO SAVEPOINT #{name}", "TRANSACTION")
end

#release_savepoint(name = current_savepoint_name) ⇒ Object



19
20
21
# File 'lib/active_record/connection_adapters/abstract/savepoints.rb', line 19

def release_savepoint(name = current_savepoint_name)
  internal_execute("RELEASE SAVEPOINT #{name}", "TRANSACTION")
end