Skip to content

Instantly share code, notes, and snippets.

@d11wtq
Created October 13, 2012 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d11wtq/3884609 to your computer and use it in GitHub Desktop.
Save d11wtq/3884609 to your computer and use it in GitHub Desktop.
module DataMapper
class Transaction
def link_with_master_slave(*things)
things = things.collect do |t|
case t
when DataMapper::Adapters::MasterSlaveAdapter
t.master
else
t
end
end
link_without_master_slave(*things)
end
alias_method_chain :link, :master_slave
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment