I have a parent with has_many children. The children have a column
''blah''. IF I do the following:
parent.children.find_by_blah(42)
The sql exectued is:
select * from blah where parent_id = 1 and blah = 42
select * from blah where parent_id = 1
The first line of sql is what I want. The second appears to be
ActiveRecord loading up all of parent.children. This I don''t want b/c
children is huge.
How do I avoid that and use idiomatic ActiveRecord?
thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---