Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5385

Standardize demongoization of uncastable values

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 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

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: