Skip to content

MONGOID-5098 Bug fix: Range.mongoize should mongoize its members #5108

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

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Dec 18, 2021

Fixes MONGOID-5098 (along with #5023 and #5025 which were already merged.)

MongoDB supports Range as a storable field type. Currently, when storing a Range of Time objects, the Range#mongoize method does not call Time#mongoize on the inner objects.

In addition, this PR improves Range.mongoize handling of Hash as an input, by removing keys which are unrelated to Range and would be junk data in DB. This case is highly unlikely to be used in any real-world app, but the existing Mongoid code supports it so we should make it work properly.

(* This PR does NOT add support for endless/beginless ranges; that will be addressed in a separate PR.)

@johnnyshields
Copy link
Contributor Author

@p-mongo this is ready for review/merge.

@johnnyshields
Copy link
Contributor Author

Let's run Evergreen and merge?

@johnnyshields
Copy link
Contributor Author

@p-mongo may we get someone to review this? This is a pretty straightforward PR.

@johnnyshields johnnyshields changed the title MONGOID-5098 Range.mongoize should mongoize its members MONGOID-5098 Bug fix: Range.mongoize should mongoize its members Jan 14, 2022
@p-mongo p-mongo requested a review from comandeo January 14, 2022 16:41
@johnnyshields
Copy link
Contributor Author

Evergreen seems stuck again?

@comandeo
Copy link
Contributor

Evergreen tests are all green.

@p-mongo p-mongo merged commit f863870 into mongodb:master Jan 18, 2022
@johnnyshields johnnyshields deleted the range-mongoize-simple branch January 18, 2022 18:10
p-mongo pushed a commit to johnnyshields/mongoid that referenced this pull request Jan 21, 2022
* master:
  MONGOID-5098 Bug fix: Range.mongoize should mongoize its members (mongodb#5108)
  MONGOID-5212 Support for Decimal128 type (mongodb#5125)
  MONGOID-5213 Document changes to BigDecimal type and addition of global flag (mongodb#5126)
  MONGOID-5209 Document "Custom Field Options" functionality + various docs improvements (mongodb#5120)
  MONGOID-5193 rails 7 support  (mongodb#5122)
  Fix default topology name - should be standalone (mongodb#5130)
  Update MRSS (mongodb#5129)
  MONGOID-5207 Test Ruby 3.1 on Evergreen (mongodb#5123)
  MONGOID-5186 .with_scope should restore previous scope (mongodb#5127)
  MONGOID-5161 - [Documentation Only] Clarify the policy for working with . and $ named fields which were introduced in MongoDB 5.0 (mongodb#5051)
p-mongo pushed a commit to johnnyshields/mongoid that referenced this pull request Jan 21, 2022
* master: (48 commits)
  MONGOID-5098 Bug fix: Range.mongoize should mongoize its members (mongodb#5108)
  MONGOID-5212 Support for Decimal128 type (mongodb#5125)
  MONGOID-5213 Document changes to BigDecimal type and addition of global flag (mongodb#5126)
  MONGOID-5209 Document "Custom Field Options" functionality + various docs improvements (mongodb#5120)
  MONGOID-5193 rails 7 support  (mongodb#5122)
  Fix default topology name - should be standalone (mongodb#5130)
  Update MRSS (mongodb#5129)
  MONGOID-5207 Test Ruby 3.1 on Evergreen (mongodb#5123)
  MONGOID-5186 .with_scope should restore previous scope (mongodb#5127)
  MONGOID-5161 - [Documentation Only] Clarify the policy for working with . and $ named fields which were introduced in MongoDB 5.0 (mongodb#5051)
  MONGOID-5173 Specs should use bang (!) methods (without describe/context change) (mongodb#5109)
  Fix doc syntax
  RUBY-2783 Require bson 4-stable for Mongoid as bson master is 5.0 and not compatible with driver (mongodb#5113)
  MONGOID-5208 fix error on reloading nil embedded document (mongodb#5116)
  MONGOID-5206 fix bug where embedded document is not re-embedded (mongodb#5115)
  MONGOID-5207 Add Ruby 3.1 to GH Actions (mongodb#5114)
  MONGOID-5207 Use YAML.safe_load in specs (mongodb#5112)
  MONGOID-5199 Reloadable#reload_embedded_document doesn't respect session (mongodb#5105)
  Fix MONGOID-5198 Calling children_changed? on a deep cyclical data structure will cause semi-infinite looping (mongodb#5104)
  MONGOID-5203 Add all available auth_mech options to Configuration documentation (mongodb#5103)
  ...
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.

4 participants