mongoid icon indicating copy to clipboard operation
mongoid copied to clipboard

MONGOID-5610 - Cleanup: Use delegator for exists? on embedded proxy, and add code comments

Open johnnyshields opened this issue 2 years ago • 1 comments

This PR is a follow-up on MONGOID-5610 with some code from my original PR branch. It does two things:

  • Use a method delegator to criteria for exists? method in lib/mongoid/association/referenced/has_many/proxy.rb. We already have other such delegators for count, etc. to it is unclear why exists? would be privileged to not have a delegator here.
  • Add additional code comments and examples. Specifically better examples are given to show why the case of false/nil arg returns false.

johnnyshields avatar Apr 20 '23 16:04 johnnyshields

@jamis this should be an easy one to merge.

johnnyshields avatar May 05 '25 20:05 johnnyshields