diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-08-20 11:39:19 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-08-20 15:08:49 -0700 |
commit | 075b91454b2cc2bd445ba0ef5bb7f4b9c74ed6ae (patch) | |
tree | 7cc27664796a7ec52e2bdc324f5434db8e52cad4 | |
parent | a4697b0cc310fd8986b9dfa226fc5c921cde603e (diff) | |
download | rails-075b91454b2cc2bd445ba0ef5bb7f4b9c74ed6ae.tar.gz rails-075b91454b2cc2bd445ba0ef5bb7f4b9c74ed6ae.tar.bz2 rails-075b91454b2cc2bd445ba0ef5bb7f4b9c74ed6ae.zip |
This method is useless without a block, so remove test
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb index a319501565..02459763f7 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -184,19 +184,17 @@ module ActiveRecord 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 |