Sha256: 48f14ed4ac8ac51992305e1a2dbe5eb74e8854ef77c78cffb3e0c493ea3ecaa7
Contents?: true
Size: 538 Bytes
Versions: 22
Compression:
Stored size: 538 Bytes
Contents
module DatabaseCleaner::DataMapper class Transaction def start(repo = :default) DataMapper.repository(repo) do |r| transaction = DataMapper::Transaction.new(r) transaction.begin r.adapter.push_transaction(transaction) end end def clean(repo = :default) DataMapper.repository(repo) do |r| adapter = r.adapter while adapter.current_transaction adapter.current_transaction.rollback adapter.pop_transaction end end end end end
Version data entries
22 entries across 22 versions & 11 rubygems