-
Type: Task
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
https://github.com/mongoid/mongoid/issues/3019
This example works on 3.1.3 but fails on 4.0.0 (f703270).
I think when the defect above was fixed it create a new problem.
class Bundle embeds_many :items end class Item embedded_in :bundle end
bundle = Bundle.new(items: Item.new) bundle.persisted? # => false bundle.items.first.persisted? # => false bundle.items = []
this results in the error below
NoMethodError: undefined method 'atomice_selector' for nil:NilClass
def embedded_atomic_selector if persisted? && _id_changed? _parent.atomic_selector else binding.pry _parent.atomic_selector.merge("#{atomic_path}._id" => _id) end end _parent # => nil
I think the code that was checking the parent needs to be added back but I can't be total sure.