39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# 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
|