Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module DataMapper
- # I was considering calling this "DataMapperMakesMeCry"
- module WrapDBChangesInTransactions
- def save(*args)
- transaction do
- super
- end
- end
- def destroy(*args)
- # Don't look at the implementation of transactions. It's a bit scary.
- transaction do
- super
- end
- end
- end
- Resource.append_inclusions(WrapDBChangesInTransactions)
- end
Add Comment
Please, Sign In to add comment