-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
More module-related issues. It seems that calling `child._association.inverse_association` on a class with a Module is broken. It seems to work if we do the classes in the root namespace.
# WITH MODULE - inverse_association BROKEN module Bad class Parent include Mongoid::Document embeds_many :kids end class Kid include Mongoid::Document embedded_in :parent end end parent = Bad::Parent.create! kid = parent.kids.create! kid._association.inverse_class #=> Bad::Parent - OK kid._association.inverse_association #=> nil - Expected to the the parent instance # WITHOUT MODULE - WORK FINE class Parent include Mongoid::Document embeds_many :kids end class Kid include Mongoid::Document embedded_in :parent end parent = Parent.create! kid = parent.kids.create! kid._association.inverse_class #=> Parent - OK kid._association.inverse_association #=> <Parent> - OK
- related to
-
MONGOID-5080 Inverses aren't found for embedded association in modules
- Backlog