Transactions
June 26, 2009
Runy on Rails has a cool support for database transactions. Basically, if you need to save 2 objects as a result of a particular action, you need to make sure that the 2nd is saved only if the first is saved successfully:
balance.transaction do
balance.save!
account.save!
end
More information here.
Entry Filed under: Uncategorized. .
Trackback this post | Subscribe to the comments via RSS Feed