From 59285f169c06554407afa3d17cb4f39b2eba382e Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Wed, 9 Dec 2020 21:15:41 +0100 Subject: [PATCH] Revert "Added alias to_h for to_hash (#277)" This reverts commit 4b65ca6f --- CHANGELOG.md | 4 +++- lib/config/options.rb | 2 -- spec/config_spec.rb | 9 --------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e290e8e7..27303e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased -... +### Bug fixes + +* Revert added alias to_h for to_hash ([#277](https://github.com/railsconfig/config/issues/277)) ## 2.2.2 diff --git a/lib/config/options.rb b/lib/config/options.rb index e5fe251e..8e84075b 100644 --- a/lib/config/options.rb +++ b/lib/config/options.rb @@ -118,8 +118,6 @@ def to_hash result end - alias :to_h :to_hash - def each(*args, &block) marshal_dump.each(*args, &block) end diff --git a/spec/config_spec.rb b/spec/config_spec.rb index ad7da5c6..bcabae11 100644 --- a/spec/config_spec.rb +++ b/spec/config_spec.rb @@ -80,15 +80,6 @@ expect(config[:section][:servers][1]).to be_kind_of(Config::Options) end - it "should convert to a hash without modifying nested settings" do - config = Config.load_files("#{fixture_path}/development.yml") - config.to_h - expect(config).to be_kind_of(Config::Options) - expect(config[:section]).to be_kind_of(Config::Options) - expect(config[:section][:servers][0]).to be_kind_of(Config::Options) - expect(config[:section][:servers][1]).to be_kind_of(Config::Options) - end - it "should convert to a json" do config = Config.load_files("#{fixture_path}/development.yml").to_json expect(JSON.parse(config)["section"]["servers"]).to be_kind_of(Array)