-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Associations
Per the current documentation of relation_class_name, it should not be used for class comparisons. Yet Mongoid has several instances of this:
lib/mongoid/association/embedded/embedded_in.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/embedded/embedded_in.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/embedded/embeds_many.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/embedded/embeds_one.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/referenced/belongs_to.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/referenced/belongs_to.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/referenced/has_and_belongs_to_many.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/referenced/has_many.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/referenced/has_one.rb: rel.relation_class_name == inverse_class_name lib/mongoid/association/relatable.rb: relation_class_name == other.relation_class_name &&
The above code should be changed to use relation_class.
- is related to
-
MONGOID-4882 Embedded documents not setting parent association if declared with a class_name having "::" prefix
- Closed
- related to
-
MONGOID-4750 Association definitions can trigger autoloading and cause NameError's
- Closed