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

validates_numericality_of is run for a nil field

    XMLWordPrintable

    Details

      Description

      So, I have...

        field :total, type: Float
        validates_numericality_of :total, :greater_than => 0, :allow_nil => true
      

      When I pass a nil value, the validation is run and marks the object as invalid.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            emirkin Eugene Mirkin
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: