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

Getting float with integer fields

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

      I have no idea why mongoid started to acting strange. This is one of the two issues I will file.

      I have a model:

      class LineItem
       field 'type', :type => Integer
       // more fields
      end
      

      For most part it works correctly, but for specific items - doing @line_item.type returns 1.0
      In the database the value is 1... not sure where mongoid decides to store the number as a float. Note that the value is 1.0 right after the query.

      I am using 2.1.9

            Assignee:
            Unassigned Unassigned
            Reporter:
            mb-dev mb-dev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: