Reputation: 12693
I'm looking at the docs here http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html
One example it gives is:
ActiveRecord::Base.transaction do
david.withdrawal(100)
mary.deposit(100)
end
Another example in the docs is:
Account.transaction do
balance.save!
account.save!
end
What's the difference between the Base
's method and the Account
's method?
Upvotes: 7
Views: 5570
Reputation: 590
The account model inherits from ActiveRecord::Base so both are actually the same methods.
Upvotes: 8