estimated_count on embedded model returning error

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Associations
    • None
    • None
    • Ruby Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      We have a handful of models that are only embedded. Calling count on them returns 0, but calling estimated_count returns an error.

      > AdditionalField.count
      => 0
      > AdditionalField.estimated_count
      /Users/kieran/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/mongoid-9.0.6/lib/mongoid/findable.rb:85: warning: Mongoid::Contextual#estimated_count at /Users/kieran/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/forwardable.rb:159 forwarding to private method Mongoid::Contextual::Memory#estimated_count
      (xpand):2:in '<main>': undefined method 'estimated_count' for an instance of Mongoid::Contextual::Memory (NoMethodError)
      
              def_instance_delegator(accessor, methods)
              ^^^^^^^^^^^^^^^^^^^^^^
      

              Assignee:
              Unassigned
              Reporter:
              Kieran Pilkington
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: