Skip to content

Commit

Permalink
Revert "Added alias to_h for to_hash (#277)"
Browse files Browse the repository at this point in the history
This reverts commit 4b65ca6
  • Loading branch information
pkuczynski committed Dec 9, 2020
1 parent aa627cf commit 59285f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions lib/config/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,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 59285f1

Please sign in to comment.