GeoEntities.update_all("terminal_id = 3", "id = 10 or id = 23 or
id = 87")
See http://ar.rubyonrails.org/classes/ActiveRecord/Base.html#M000351
Vish
On 9/25/06, Yuri Leikind
<yuri.leikind-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> Hi all,
>
> I have 2 tables and a standard one-to-many association.
>
> How do I substitute the following sql with ActiveRecord calls so that
> it uses just one sql statement:
>
> update geo_entities set terminal_id = 3 where id = 10 or id = 23
> or id = 87;
>
> Thank you!
>
>
> Regards,
> Yuri Leikind
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---