mongoid
mongoid copied to clipboard
MONGOID-5610 - Cleanup: Use delegator for exists? on embedded proxy, and add code 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
criteriaforexists?method inlib/mongoid/association/referenced/has_many/proxy.rb. We already have other such delegators forcount, etc. to it is unclear whyexists?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/nilarg returnsfalse.
@jamis this should be an easy one to merge.