Skip to content

Commit

Permalink
This method is useless without a block, so remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 20, 2012
1 parent a4697b0 commit 075b914
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -184,19 +184,17 @@ def transaction(options = {})
transaction_open = false transaction_open = false


begin begin
if block_given? if requires_new || open_transactions == 0
if requires_new || open_transactions == 0 if open_transactions == 0
if open_transactions == 0 begin_db_transaction
begin_db_transaction elsif requires_new
elsif requires_new create_savepoint
create_savepoint
end
increment_open_transactions
transaction_open = true
@_current_transaction_records.push([])
end end
yield increment_open_transactions
transaction_open = true
@_current_transaction_records.push([])
end end
yield
rescue Exception => database_transaction_rollback rescue Exception => database_transaction_rollback
if transaction_open && !outside_transaction? if transaction_open && !outside_transaction?
transaction_open = false transaction_open = false
Expand Down

0 comments on commit 075b914

Please sign in to comment.