Skip to content

Commit

Permalink
Revert "Added alias to_h for to_hash (rubyconfig#277)" (rubyconfig#295)
Browse files Browse the repository at this point in the history
This reverts commit 4b65ca6
  • Loading branch information
pkuczynski authored and ippachi committed Oct 3, 2021
1 parent 98d05d8 commit 082a2e6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Bug fixes

...
* Revert added alias to_h for to_hash ([#277](https://github.com/railsconfig/config/issues/277))

### Changes

Expand Down
2 changes: 0 additions & 2 deletions lib/config/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ def to_hash
result
end

alias :to_h :to_hash

def each(*args, &block)
marshal_dump.each(*args, &block)
end
Expand Down
9 changes: 0 additions & 9 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 082a2e6

Please sign in to comment.