Storing false values in fields of Array and Hash types fails but not in an expected way

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 7.0.6, 7.1.0
    • Affects Version/s: 7.0.0, 6.2.1, 6.3.0, 6.4.0, 6.4.1, 7.0.1, 7.0.2, 6.4.2, 7.0.3, 6.4.4, 7.0.4, 7.0.5
    • Component/s: Attributes
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      class Person
        include Mongoid::Document
        field :map, type: Hash
      end
      
      person = Person.new
      
      person.map = false
      

      Expected behavior:

      A Mongoid::Errors::InvalidValue error is raised.

      Actual behavior:
      A NoMethodError: undefined method `update_values' for false:FalseClass error is raised.

              Assignee:
              Oleg Pudeyev (Inactive)
              Reporter:
              Gabriel Prado
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: