Permalink
Browse files

This method is useless without a block, so remove test

  • Loading branch information...
tenderlove committed Aug 20, 2012
1 parent a4697b0 commit 075b91454b2cc2bd445ba0ef5bb7f4b9c74ed6ae
Showing with 9 additions and 11 deletions.
  1. +9 −11 activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -184,19 +184,17 @@ def transaction(options = {})
transaction_open = false
begin
- if block_given?
- if requires_new || open_transactions == 0
- if open_transactions == 0
- begin_db_transaction
- elsif requires_new
- create_savepoint
- end
- increment_open_transactions
- transaction_open = true
- @_current_transaction_records.push([])
+ if requires_new || open_transactions == 0
+ if open_transactions == 0
+ begin_db_transaction
+ elsif requires_new
+ create_savepoint
end
- yield
+ increment_open_transactions
+ transaction_open = true
+ @_current_transaction_records.push([])
end
+ yield
rescue Exception => database_transaction_rollback
if transaction_open && !outside_transaction?
transaction_open = false

0 comments on commit 075b914

Please sign in to comment.