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

🚀 [READY FOR REVIEW] MONGOID-5559 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric #5469

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

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Sep 18, 2022

Refer to MONGOID-5559.

The main effect of this is that BigDecimal will evolve correctly to Date/Time (as Integer/Float do today.)

Since BigDecimal is a numeric type, it should include the Mongoid::Criteria::Queryable::Extensions::Numeric module in case additional functionality is added in the future as well.

@johnnyshields johnnyshields changed the title MONGOID-5485: Fix BigDecimal evolution to Date/Time MONGOID-5485 - Bugfix: BigDecimal should evolve correctly to Date/Time Sep 18, 2022
@johnnyshields johnnyshields changed the title MONGOID-5485 - Bugfix: BigDecimal should evolve correctly to Date/Time MONGOID-5485 - Bugfix: BigDecimal should evolve correctly to Date/Time (as Integer/Float do) Sep 18, 2022
@johnnyshields
Copy link
Contributor Author

johnnyshields commented Oct 6, 2022

@Neilshweky @comandeo ready for review.

@johnnyshields johnnyshields changed the title MONGOID-5485 - Bugfix: BigDecimal should evolve correctly to Date/Time (as Integer/Float do) MONGOID-5485 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric Feb 1, 2023
@johnnyshields johnnyshields changed the title MONGOID-5485 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric [READY FOR REVIEW] MONGOID-5485 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric Feb 10, 2023
@johnnyshields johnnyshields changed the title [READY FOR REVIEW] MONGOID-5485 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric [READY FOR REVIEW] MONGOID-5559 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric Feb 10, 2023
@@ -79,3 +79,5 @@ def evolve(object)

::Float.__send__(:include, Mongoid::Criteria::Queryable::Extensions::Numeric)
::Float.__send__(:extend, Mongoid::Criteria::Queryable::Extensions::Numeric::ClassMethods)

::BigDecimal.__send__(:include, Mongoid::Criteria::Queryable::Extensions::Numeric)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extend ClassMethods not needed here since it mainly exists to define evolve which is done differently for BigDecimal already. (In the future, all this stuff typecasting stuff needs to be refactored.)

@johnnyshields johnnyshields changed the title [READY FOR REVIEW] MONGOID-5559 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric 🚀 [READY FOR REVIEW] MONGOID-5559 - Bugfix: BigDecimal should include Mongoid::Criteria::Queryable::Extensions::Numeric Apr 12, 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
1 participant