Thursday, July 1, 2010

[Rails] active record question

I have three models, Question, Response and User

User has many question, :through Responses

My response table has 3 main columns response, question_id and
user_id.

The use case is lets say the user can respond to 100 question, but
during a session he responds to 20. How do I find out the ones he has
not respondeded to. In this case the response table will have 20
records and I woukd like to show the user the rest of the 80 he has
not responded to.

Thanks

--
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


Real Estate