Skip to content

Instantly share code, notes, and snippets.

@Ragmaanir
Created June 3, 2011 17:19
Show Gist options
  • Save Ragmaanir/1006717 to your computer and use it in GitHub Desktop.
Save Ragmaanir/1006717 to your computer and use it in GitHub Desktop.
before :create do
@temp_tx = DataMapper::Transaction.new(Friendship)
@temp_tx.begin
end
after :create do
(@temp_tx.rollback and throw :halt) if some_conditions
@temp_tx.commit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment