Created
December 17, 2010 22:10
Revisions
-
jpr5 created this gist
Dec 17, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ Depends on: - https://github.com/datamapper/do/commit/74645c46ac9b210c5e4029853b8a23fe02defd71 - https://github.com/datamapper/dm-transactions/commit/242e60473a341a151df62ea707264f06f418b077 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ known_repositories = ::DataMapper::Model.descendants.map { |m| m.repository }.uniq Before do known_repositories.each do |r| t = r.transaction t.begin r.adapter.push_transaction(t) end end After do known_repositories.each do |r| t = r.adapter.pop_transaction t.rollback end end