rubyconfig / config

Easiest way to add multi-environment yaml settings to Rails, Sinatra, Padrino and other Ruby projects.
Other
2.1k stars 230 forks source link

Avoid defining `Hash#deep_merge` and `#deep_merge!` #342

Closed jonathanhefner closed 11 months ago

jonathanhefner commented 11 months ago

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 #314.

pkuczynski commented 11 months ago

@cjlarose what do you think?

jonathanhefner commented 11 months ago

Could you please update the CHANGELOG as well?

Done!

pkuczynski commented 11 months ago

@jonathanhefner I extended our test suite for Rails 7.x in #344, but test fails with a can't modify frozen Array error. We need this to verify your proposed solution. As I am not developing in Ruby anymore for several years, I am not able to fix it quickly. Would you mind having a look at #344?

pkuczynski commented 11 months ago

344 got finally merged so we can verify this PR agains Rails 7.x. Let's see if it works.

pkuczynski commented 11 months ago

Looks it works! Merging and releasing...