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

Mongoid::Attributes.attribute_present? incorrectly returns false for boolean values that are present but false

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.1.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      The Mongoid::Attributes.attribute_present? method reads the attribute then returns value.blank? This is not a correct implementation for boolean values. The blank? method returns true if a boolean value is false. Thus, attribute_present? incorrectly returns false for boolean values that are present but false.

      This implementation is a copy of the ActiveRecord.attribute_present? method, for which I have also submitted a bug here:

      https://github.com/rails/rails/issues/1613

            Assignee:
            Unassigned Unassigned
            Reporter:
            schmickie schmickie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: