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

Range field type/extension seems to have a weird bug if given a string

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The https://github.com/mongoid/mongoid/blob/master/lib/mongoid/extensions/range.rb Data/Field type seems to have a bug when passed a string instead of a range by mistake, I encountered the behavior VIA my Rails Driven RESTish API.

      request

      {
          "age_range": "10..55"
      }
      

      Stored value in mongo

      {
          "age_range": {
              "min": 1,
              "max": 5
          }
      }
      

      My MODEL

      class User
      	include Mongoid::Document
      	field :age_range,                type: Range
      end
      

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            mxaddict mxaddict
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: