Skip to content

Commit

Permalink
Fixed Sequel::Transaction so that it works with latest Sequel.
Browse files Browse the repository at this point in the history
Previously it would crash.
  • Loading branch information
japgolly committed Feb 20, 2012
1 parent aaafef4 commit 9b7bdd2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/database_cleaner/sequel/transaction.rb
Expand Up @@ -6,14 +6,16 @@ class Transaction

def start
@transactions ||= []
db.send(:add_transaction)
@transactions << db.send(:begin_transaction, db)
opts= {:savepoint => true}
db.send(:add_transaction, db, opts)
db.send(:begin_transaction, db, opts)
@transactions << db
end

def clean
transaction = @transactions.pop
db.send(:rollback_transaction, transaction)
db.send(:remove_transaction, transaction)
db= @transactions.pop
db.send(:rollback_transaction, db)
db.send(:remove_transaction, db, false)
end
end
end
Expand Down

0 comments on commit 9b7bdd2

Please sign in to comment.