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-5671 [Monkey Patch Removal] Remove Object#blank_criteria? and Hash#__mongoid_unsatisfiable_criteria? #5700

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Sep 2, 2023

Fixes MONGOID-5671

This PR removes two related kernel monkey patch methods:

  • Remove Object#blank_criteria? method entirely (was previously @deprecated and not used in code.)
  • Remove Hash#_mongoid_unsatisfiable_criteria? method (was previously marked @api private, name contains underscore) and move it to a private method of Referenced::HasMany::Enumerable.

Similar to #5689, I have kept the specs for a previously public method which is now private. My reasoning is the same--the method is only used in one class, therefore should be private, and its better to keep the specs intact for future refactoring.

  • TODO: Move private method tests to cover a public method behavior.

Overall progress is tracked here: http://tinyurl.com/mongoid-monkey. Refer to MONGOID-5660 for context.

…eprecated and not used in code.)

- Remove ``Hash#_mongoid_unsatisfiable_criteria?`` method is removed (was previously marked @api private) and move it to a private method of Referenced::HasMany::Enumerable.
@johnnyshields johnnyshields changed the title Remove Object#blank_criteria? and Hash#__mongoid_unsatisfiable_criteria? De-Monkey-Patchification -- Remove Object#blank_criteria? and Hash#__mongoid_unsatisfiable_criteria? Sep 2, 2023
@johnnyshields johnnyshields changed the title De-Monkey-Patchification -- Remove Object#blank_criteria? and Hash#__mongoid_unsatisfiable_criteria? MONGOID-5671 [Monkey Patch Removal] Remove Object#blank_criteria? and Hash#__mongoid_unsatisfiable_criteria? Sep 3, 2023
@johnnyshields johnnyshields marked this pull request as draft September 5, 2023 15:31
johnnyshields and others added 2 commits November 8, 2023 06:46
this tests an implementation detail and not a behavior, which is
fragile. I'm not even sure this is an implementation detail we want,
and testing it specifically pours metaphorical concrete around it,
making it that much harder to remove later.
@jamis jamis marked this pull request as ready for review November 7, 2023 22:58
@jamis jamis merged commit fb1d280 into mongodb:master Nov 7, 2023
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.

2 participants