After loading model, can it be again accessed without SQL...

Kendall Buchanan
Mon, 16 Apr 2007 16:07:31 -0000

Quick question:

1 User -> many Accounts

If I eager load the user with: my_user = User.find(:first, include =>
[:accounts])

How can I then use criteria to work with the "accounts" without making
another query to the database?

Iteration is one option, but it would be best to avoid it if say I
wanted one of the accounts in the user by :name => "Checking
Account".

Thanks a lot of any advice.

Kendall Buchanan

--
Posted via http://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