This has probably been covered before, but I hadn''t found much of a fix. I have two tables, one with has_many, and another with belongs_to. When I do user = User.find 1, it doesn''t pull up User.notes, it says it''s "not loaded yet". How do I fix this? I remember reading something about it when I first ran across edge, but lost the location. Any help would be fantastic. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Wed, Dec 06, 2006 at 07:35:33PM -0000, mrkris wrote:> > This has probably been covered before, but I hadn''t found much of a > fix. I have two tables, one with has_many, and another with belongs_to. > When I do user = User.find 1, it doesn''t pull up User.notes, it says > it''s "not loaded yet". How do I fix this? I remember reading something > about it when I first ran across edge, but lost the location. Any help > would be fantastic.Maybe what you want is: User.find(1, :include => [ :notes ]) -- Cheers, - Jacob Atzen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 12/6/06, mrkris <cloper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > This has probably been covered before, but I hadn''t found much of a > fix. I have two tables, one with has_many, and another with belongs_to. > When I do user = User.find 1, it doesn''t pull up User.notes, it says > it''s "not loaded yet". How do I fix this? I remember reading something > about it when I first ran across edge, but lost the location. Any help > would be fantastic.Do anything else with user.notes to load it, such as user.notes.to_a, or force load it with user.notes(true). This issue will be fixed shortly. jeremy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sounds good. Thanks Jeremy + Jacob, you answered my question :) On 12/6/06, Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote:> > On 12/6/06, mrkris <cloper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > This has probably been covered before, but I hadn''t found much of a > > fix. I have two tables, one with has_many, and another with belongs_to. > > When I do user = User.find 1, it doesn''t pull up User.notes, it says > > it''s "not loaded yet". How do I fix this? I remember reading something > > about it when I first ran across edge, but lost the location. Any help > > would be fantastic. > > > Do anything else with user.notes to load it, such as user.notes.to_a, or > force load it with user.notes (true). > > This issue will be fixed shortly. > > jeremy > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---