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

#count return type

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

      According to https://github.com/mongoid/mongoid/blob/master/lib/mongoid/finders.rb#L20 #count is claiming to return an Integer. But it's not.

      irb(main):001:0> Event.count
      => 7.0
      irb(main):002:0> Event.count.class
      => Float

      I didn't dive into current architecture but I guess it what moped returns, anyways, if it is not a bug and just outdated docs, it would be both strange and inconvenient because of extra steps needed to provide a proper rendering of count values on a page.

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

              Created:
              Updated:
              Resolved: