using transaction in ruby on rails

Try this...

transaction do
  david.withdrawal(100)
  mary.deposit(100)
end

http://www.bigbold.com/snippets/posts/show/381

Andy