-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Attributes
-
None
As part of MONGOID-5222 we've decided to expand this to standardize the demongoization of uncastable values. This situation arises when data is stored by another application in a form that is inconsistent with the field type declared by Mongoid. In this cases Mongoid should demongoize data in a manor consistent across all types.
The decided functionality is as follows:
Declare a flag (perhaps, validate_db_attribute_types) that:
1) when true, raises an error on instantiation of the document
2) when false, returns nil
The action items are as follows:
create the ``validate_db_attribute_types`` flag
document feature flag
standardize demongoization functionality (always raise, rescue on flag)
create InvalidDBValue error
write release note for this change
add documentation to Uncastable values section
add note to custom types protocol
- duplicates
-
MONGOID-5221 Always demongoize uncastable values to nil
- Closed
- is duplicated by
-
MONGOID-5221 Always demongoize uncastable values to nil
- Closed