-
Type: Task
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
I've just run all my tests against v5.0.0.beta. All passed on f56b96b but on the beta I have a test where I am saving on an embedded object. This appears to fail silently.
This is happening in an Rspec and only very rarely. I have no idea why. I looked through a diff of the code and nothing special jumps out other than the beta of the mongo driver.
Here's example code that shows what is happening...
class Parent include Mongoid::Document include Mongoid::Timestamps embeds_many :child, class_name: 'Child', inverse_of: :parent, validate: false, cascade_callbacks: true end class Child include Mongoid::Document include Mongoid::Timestamps embedded_in :parent end raise unless child.some_attribute == 1 child.some_attribute = 2 child.save new_child = Child.<get from db> raise unless new_child.some_attribute == 2 # raises here