The query Mongoid is executing does not make sense to me, and I think I must be defining a couple of things wrong.
But I do not know what the problem is
==Model Definition==
User
references_many :questions_about, :class_name=>"Question", :inverse_of => :about_user
Question
references_in :about_user, :class_name=>"User",:inverse_of => :questions_about
Console:
u=User.find("nazroll")
u.questions_about.map
db['questions'].find({"user_id"=>#010b}, {})
The correct query that should have been executed should be
db['questions'].find({"ABOUT_user_id"=>#010b}, {})
This is because I am defining the inverse of the :questions_about as :about_user
Any help rendered is greatly appreciated – tearing my head out. Thanks!
Ok, it was actually because i was using an older version of mongoid, which was actually seriously buggy.
Upgrade to the latest version and all is fine