does user_instance.culture_id return something? try doing the Picture query by putting in the culture_id yourself. maybe you dont have a picture with that culture_id
Picture.where(:album_id => :album, :culture_id =>3).first On Tue, Jun 14, 2011 at 11:26 AM, joanne ta <[email protected]> wrote: > I run those code in terminal > > user_instance = User.find(1) > > => it shows me all the data in the User table > and then i run > > Picture.where(:album_id => :album, :culture_id => > user_instance.culture_id).first > =>nil > > > > > > On Tue, Jun 14, 2011 at 2:15 PM, Tim Shaffer <[email protected]> wrote: >> >> I cannot explain it. You're not providing enough information about your >> environment and any error messages you may or may not be receiving. >> >> Which part returns nil? >> >> Did you run this on the command line? >> user_instance = User.find(1) >> >> Did it return nil? If so, you probably don't have a user by the ID of 1 in >> your database. Adjust accordingly to fit your environment. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-talk/-/m-fUx744LKkJ. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > -------------------------------- > > Thank you, > > Yen > > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

