Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Apr 20, 2023

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.

Also cleans up method docs which were not accurate.
@johnnyshields johnnyshields changed the title Bug Fix: Fix using exists? with args on relations. Bug Fix: Allow using exists? with args on relations. Apr 20, 2023
@johnnyshields johnnyshields changed the title Bug Fix: Allow using exists? with args on relations. MONGOID-5608 - Bug Fix: Allow using exists? with args on relations Apr 20, 2023
@johnnyshields johnnyshields marked this pull request as draft April 20, 2023 17:05
@johnnyshields johnnyshields changed the title MONGOID-5608 - Bug Fix: Allow using exists? with args on relations MONGOID-5608 / MONGOID-5610 - Bug Fix: Allow using exists? with args on relations, exists? on embedded should only return false Apr 21, 2023
@johnnyshields johnnyshields marked this pull request as ready for review November 7, 2023 21:52
@johnnyshields johnnyshields changed the title MONGOID-5608 / MONGOID-5610 - Bug Fix: Allow using exists? with args on relations, exists? on embedded should only return false MONGOID-5608 / MONGOID-5610 - Code Cleanup: Allow using exists? with args on relations, exists? on embedded should only return false Nov 7, 2023
@johnnyshields johnnyshields changed the title MONGOID-5608 / MONGOID-5610 - Code Cleanup: Allow using exists? with args on relations, exists? on embedded should only return false MONGOID-5610 - Use delegator for exists? on embedded proxy, and add code comments. Nov 16, 2023
@johnnyshields johnnyshields changed the title MONGOID-5610 - Use delegator for exists? on embedded proxy, and add code comments. MONGOID-5610 - Cleanup: Use delegator for exists? on embedded proxy, and add code comments Nov 16, 2023
@johnnyshields johnnyshields changed the title MONGOID-5610 - Cleanup: Use delegator for exists? on embedded proxy, and add code comments [READY FOR REVIEW] MONGOID-5610 - Cleanup: Use delegator for exists? on embedded proxy, and add code comments Nov 25, 2023
@jamis jamis changed the title [READY FOR REVIEW] MONGOID-5610 - Cleanup: Use delegator for exists? on embedded proxy, and add code comments MONGOID-5610 - Cleanup: Use delegator for exists? on embedded proxy, and add code comments Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant