Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rails transactions

def transfer_money   ActiveRecord::Base.transaction do    john.update!(money: john.money + 100)    ted.update!(money: ted.money - 100)  end end
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #rails #transactions
ADD COMMENT
Topic
Name
8+2 =