using transaction in ruby on rails

0 views
Skip to first unread message

Santosh R patil

unread,
Feb 6, 2007, 12:45:51 AM2/6/07
to rubyonra...@googlegroups.com
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

--
Posted via http://www.ruby-forum.com/.

Andy Triboletti

unread,
Feb 6, 2007, 2:19:07 AM2/6/07
to Ruby on Rails: Talk
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 <rails-mailing-l...@andreas-s.net>
wrote:

Reply all
Reply to author
Forward
0 new messages