Skip to content

Commit

Permalink
Use unsafe_load when loading config to support aliases with psych 4 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jduff authored Aug 4, 2021
1 parent 9bd3161 commit e779e7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### New Features

* [#801](https://github.com/toptal/chewy/pull/801): Add the [`track_total_hits`](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-your-data.html#track-total-hits) option to the query. ([@milk1000cc][])
* [#810](https://github.com/toptal/chewy/pull/810): Use `unsafe_load` when loading config to support Psych 4.

### Changes

Expand Down
2 changes: 1 addition & 1 deletion lib/chewy/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def yaml_settings

if File.exist?(file)
yaml = ERB.new(File.read(file)).result
hash = YAML.load(yaml) # rubocop:disable Security/YAMLLoad
hash = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(yaml) : YAML.load(yaml) # rubocop:disable Security/YAMLLoad
hash[Rails.env].try(:deep_symbolize_keys) if hash
end
end || {}
Expand Down

0 comments on commit e779e7d

Please sign in to comment.