Skip to content

MONGOID-5702: Monkey Patch Removal: Remove __numeric__ class method from Numeric module #5746

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

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

Conversation

johnnyshields
Copy link
Contributor

It is now inlined into its only usage. It was previously declared @api private so assume it is safe to delete.

…dule. It is now inlined into its only usage. It was previously declared @api private so assume it is safe to delete.
@johnnyshields johnnyshields changed the title Monkey Patch Removal: Remove __numeric__ class method from Numeric module MONGOID-5702: Monkey Patch Removal: Remove __numeric__ class method from Numeric module Nov 13, 2023
@johnnyshields johnnyshields changed the title MONGOID-5702: Monkey Patch Removal: Remove __numeric__ class method from Numeric module [READY FOR REVIEW] MONGOID-5702: Monkey Patch Removal: Remove __numeric__ class method from Numeric module Nov 25, 2023
@johnnyshields johnnyshields requested a review from a team as a code owner May 5, 2025 20:44
@johnnyshields johnnyshields requested a review from jamis May 5, 2025 20:44
@johnnyshields
Copy link
Contributor Author

This should be a straightforward merge.

@jamis jamis changed the title [READY FOR REVIEW] MONGOID-5702: Monkey Patch Removal: Remove __numeric__ class method from Numeric module MONGOID-5702: Monkey Patch Removal: Remove __numeric__ class method from Numeric module May 5, 2025
@jamis
Copy link
Contributor

jamis commented May 5, 2025

@johnnyshields thanks for this one, yeah, it should be totally safe to apply, thanks to that private flag.

However, I feel like this is a step backward in readability. The evolve method is harder to grok at a glance. I understand wanting to remove monkeypatched methods on standard classes (three cheers for fixing that, hurray!) but I feel like there's still value in isolating the responsibility that __numeric__ currently holds.

Mongoid::Utils might be a reasonable host for such functionality, if the goal is primarily to remove that monkeypatch.

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