The scenario is:
How can an Account give ratings to another account? This results in two lists on the Account. Those who I have rated and those who have rated me. (my_ratings and ratings_given)
This boils down to:
How can multiple 1 - N relationsips to the same entity work in Mongoid?
In Mongoid's Docs it says you can use has_many
and belongs_to
to link the entities together.
I currently have this on Account
has_many :ratings, :as => "my_ratings"
has_many :ratings, :as => "ratings_given"
and this on Ratings:
belongs_to :user, :as => 'Rater'
belongs_to :user, :as => 'Ratie'
The docs don't cover this case, so I thought you would have to differentiate between the two with an :as parameter.
Is this even remoting correct?