[Rails] Re: Active Record Issue (I think)
"User.first.id" returns "3", I guess I did some edit/deletes.
"Micropost.first.user" returns "nil".
"Micropost.first.user_id" returns "1" oddly enough.
Interesting, but what I don't get, is "User.first" selects the first
user (regardless of their id). So "User.first.microposts" should give
me the first user's microposts I would think, no?
I'm wondering if as I was going through this tutorial, maybe I screwed
some things up?
Thanks for the replies btw!
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home