transactions de rails
def transfer_money ActiveRecord::Base.transaction do john.update!(money: john.money + 100) ted.update!(money: ted.money - 100) end end
Worrisome Worm