-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
lib/mongoid/copyable.rb#L24-25 clones a document to an attributes hash and constructs a new document with it. This will cause an error relating to dynamic attributes when the document to be cloned has a field present which has since been removed from the model definition.
The desired behavior (I believe) would be either to ignore these extra attributes, or include them in the clone (as it is a clone of an existing document). Including the dynamic attribute behavior is not appropriate in this scenario.
Additionally, there is no batch unset() operation provided by mongoid for use with migrations that might drop these unused fields.
(Mongoid 4.0.0)
- is related to
-
MONGOID-3766 Ignore extra attributes on clone when not using Dynamic Attributes
- Closed