Transactions in Rails / Active Record
transaction do david.withdrawal(100) mary.deposit(100) end
DZone Snippets > peter > database
12122 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Peter Cooperx http://www.petercooper.co.uk/
transaction do david.withdrawal(100) mary.deposit(100) end
REPAIR TABLE tbl_name QUICK;
ActiveRecord::Base.connection.select_one('select sum(quantity) from table').to_i arrayofhashes = ActiveRecord::Base.connection.select_all('select * from table')