-
Notifications
You must be signed in to change notification settings - Fork 1.4k
MONGOID-5221/5222: Fix mongoization + demongoization of non-empty string as Integer/Float #5220
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
Conversation
…mongoization-of-int-float-non-emty-string'
The ticket is for demongoization, this PR changes mongoization and demongoization. The to_i/to_f calls should remain as they were, they are not equivalent to calling Integer()/Float(). |
@p-mongo I've clarified in the ticket the behavior should be identical for both mongoization and demongoization. There's no reason to convert the string "Foobar" to 0; it should be nil as it is non-sensical. Note that (BigDecimal by the way already does the correct thing both mongoization and demongoization) |
…6-fix-mongoization-of-int-float-non-emty-string
@p-mongo please consider merging this at this time. While I appreciate there is an epic to fully review mongoization/demongoization, this PR is a "quick win" for a Float/Integer which are very commonly used. |
I responded in https://jira.mongodb.org/browse/MONGOID-5222. |
This is a partial fix for MONGOID-5222 and MONGOID-5221