-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Associations
Gives those classes :
module Blog class Article include Mongoid::Document embeds_many :comments end class Comment include Mongoid::Document embedded_in :article end end
Blog::Article.relations[:comments].inverse and Blog::Comment.relations[:article].inverse give nil because, at this line, rel.relation_class_name gives "Article" and inverse_class_name gives "Blog::Article". At this line, rel.relation_class_name gives "Comment" and inverse_class_name gives "Blog::Comment".
Maybe those lines have to be changed to :
rel.relation_class_name.sub(/\A::/, '') == inverse_class_name.sub(/\A::/, '')
- is duplicated by
-
MONGOID-5275 Embedded Associations inside submodules cannot find inverses
- Closed
- is related to
-
MONGOID-5398 Using modules breaks inverse_association of embeds
- Backlog
-
MONGOID-5275 Embedded Associations inside submodules cannot find inverses
- Closed
-
MONGOID-5090 Document how association class names are looked up when modules are involved
- Backlog
- links to