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

Allow block form in Mongoid::Association::EmbedsMany::Proxy#count

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Unknown
    • Resolution: Fixed
    • None
    • 7.4.0
    • Associations
    • None
    • Fully Compatible

    Description

      Mongoid::Association::EmbedsMany::Proxy#count should allow block form to make it congruent with #any?, #none?, #all?, etc.

      Example:
      Person.addresses.count

      {|a| a.country == "FR" }

      I've also added additional tests for other methods #any?#none?#all?
       

      https://github.com/mongodb/mongoid/pull/5000

      Attachments

        Activity

          People

            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: