Skip to content

Instantly share code, notes, and snippets.

@francois
Created October 17, 2008 13:27
Show Gist options
  • Save francois/17409 to your computer and use it in GitHub Desktop.
Save francois/17409 to your computer and use it in GitHub Desktop.
setup do
logger.debug {"transaction setup"}
@__transaction = DataMapper::Transaction.new(DataMapper.repository(:default))
logger.debug {"transaction begin"}
@__transaction.begin
end
teardown do
if @__transaction
logger.debug {"transaction rollback"}
@__transaction.rollback
@__transaction = nil
end
logger.debug {"transaction teardown"}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment