Forum: Ruby on Rails using transaction in ruby on rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Santosh R. (Guest)
on 2007-02-06 07:45
Hi,

How to use transaction in my application.

I have lot of insert sql statement to be done into different table and I
am doing it in controller. How can I implement transaction in
controller?
Please help to solve this
Andy T. (Guest)
on 2007-02-06 09:20
(Received via mailing list)
Try this...


transaction do
  david.withdrawal(100)
  mary.deposit(100)
end

http://www.bigbold.com/snippets/posts/show/381

Andy


On Feb 5, 7:45 pm, Santosh R patil <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.