module ActiveRecord::ConnectionAdapters::DatabaseStatements
Attributes
commit_at_open_transaction_level[W]
Allow for setting a 'base' number of open transactions at which a commit should fire commit callbacks, when nesting transactional example groups.
Public Instance Methods
commit_at_open_transaction_level()
click to toggle source
# File lib/prefactory/active_record_integration.rb, line 35 def commit_at_open_transaction_level @commit_at_open_transaction_level || 1 end
transaction(options = {}, &block)
Also aliased as: transaction_without_transactional_specs
Alias for: transaction_with_transactional_specs
transaction_with_transactional_specs(options = {}) { || ... }
click to toggle source
# File lib/prefactory/active_record_integration.rb, line 39 def transaction_with_transactional_specs(options = {}, &block) return_value = nil rolled_back = false transaction_without_transactional_specs(options.merge(:requires_new => true)) do begin return_value = yield rescue StandardError => e rolled_back = true raise e end if !rolled_back && open_transactions <= commit_at_open_transaction_level + 1 current_transaction.instance_variable_set(:@fake_commit, true) current_transaction.instance_variable_set(:@run_commit_callbacks, true) end end return_value end
Also aliased as: transaction