> --
> 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 rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> 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 view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/OR8oidO5TWwJ.
I'm not sure what you're trying to say.
When you use "culture_id" in the where clause, it needs to have a value. This value can come from any number of places such as a user instance, query parameter, or even be hard coded.
--
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/-/zcHnTSvbAHIJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
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 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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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
As others have said, you are not providing enough information to diagnoise the
problem. Let's break it down.
Find the first user. Does it have a culture_id field? What is it's value?
user = User.first
Find all the pictures associated with this user. Are there any? Do any have
the same culture_id as the user?
Picture.where(:user => user)
I am guessing you have a particular album in mind, which collates various
pictures (why are you using a symbol here?). Does this album contain the
picture with the "correct" culture_id?
Album.where(:user=> user, :album => album).pictures
If the answer to all these questions is "yes", then your code should work. If
not, it will tell you excactly where you have gone wrong.