-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
avoid Hash monkey patch when loading DeepMerge #314
Labels
Milestone
Comments
If end users want either of the monkey patches, they can require them directly: require 'deep_merge/deep_merge_hash' require 'deep_merge/rails_compat' |
I'm open to a PR with this change. I'll likely bump the major version, though, since it's possible someone is implicitly depending on the |
jonathanhefner
added a commit
to jonathanhefner/rubyconfig-config
that referenced
this issue
Oct 2, 2023
`config` uses `DeepMerge.deep_merge!` instead of `Hash#deep_merge!`, so monkey patching `Hash` is unnecessary. Furthermore, DeepMerge's `Hash` monkey patch is not compatible with Rails 7.1 (see [rails#49457][]). This commit changes `require 'deep_merge'` to `require 'deep_merge/core'` so that DeepMerge's `Hash` monkey patch is no longer loaded. Users who rely the monkey patch can load it manually via `require 'deep_merge/deep_merge_hash'`. Closes rubyconfig#314. [rails#49457]: rails/rails#49457
jonathanhefner
added a commit
to jonathanhefner/rubyconfig-config
that referenced
this issue
Oct 3, 2023
`config` uses `DeepMerge.deep_merge!` instead of `Hash#deep_merge!`, so monkey patching `Hash` is unnecessary. Furthermore, DeepMerge's `Hash` monkey patch is not compatible with Rails 7.1 (see [rails#49457][]). This commit changes `require 'deep_merge'` to `require 'deep_merge/core'` so that DeepMerge's `Hash` monkey patch is no longer loaded. Users who rely on the monkey patch can load it manually via `require 'deep_merge/deep_merge_hash'`. Closes rubyconfig#314. [rails#49457]: rails/rails#49457
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
followup to #120
DeepMerge
can be loaded in 3 different ways:core
librarycore
library + the defaultHash
monkey patchcore
library + an alternativeHash
monkey patch that does not conflict withActiveSupport
Config
is currently using the 2nd variant:config/lib/config.rb
Line 9 in 9c35a5d
However,
Config
does not actually use the monkey patch, so it should switch to the 1st variant:This is conceptually cleaner and prevents the conflict with
ActiveSupport
.The text was updated successfully, but these errors were encountered: