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

Float/Integer demongoization of non-empty string returns zero, should be nil

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Float/Integer demongoization of non-empty string returns zero, should be nil.

      BigDecimal handles this case correctly.

       

       

      Integer.demongoize("")     #=> nil
      Float.demongoize("")       #=> nil
      BigDecimal.demongoize("")  #=> nil
      Integer.demongoize("Foobar")     #=> 0
      Float.demongoize("Foobar")       #=> 0
      BigDecimal.demongoize("Foobar")  #=> nil
      

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: