-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I'm having an issue with the has_and_belongs_to_many relation. I can't seem to retrieve the relation objects through their instances.
The code:
class User include Mongoid::Document has_and_belongs_to_many :badges end class Badge include Mongoid::Document has_and_belongs_to_many :users end
The code i'm testing it:
Badge.first # #<Badge _id: 50467bd226613b7f66000001, ... , user_ids: ["50478de726613be123000003", "50478e7026613be123000006"]> User.find("50478de726613be123000003").badges # [] empty