Re: using transaction in ruby on rails

Andy Triboletti
2007-02-06T07:19:07Z

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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> 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 viahttp://www.ruby-forum.com/.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---