Skip to content

Commit

Permalink
Avoid defining Hash#deep_merge and #deep_merge!
Browse files Browse the repository at this point in the history
`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 #314.

[rails#49457]: rails/rails#49457
  • Loading branch information
jonathanhefner committed Oct 2, 2023
1 parent c790118 commit 6f335b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require 'config/sources/hash_source'
require 'config/sources/env_source'
require 'config/validation/schema'
require 'deep_merge'
require 'deep_merge/core'

module Config
extend Config::Validation::Schema
Expand Down

0 comments on commit 6f335b1

Please sign in to comment.