Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Enabled aliases for vanity.yml config file (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostmark authored Mar 7, 2022
1 parent 1b3dd5a commit 707c1ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vanity/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def connection_params(file_name = nil)
file_path = File.join(config_path, file_name)

if File.exist?(file_path) # rubocop:todo Style/GuardClause
config = YAML.safe_load(ERB.new(File.read(file_path)).result)
config = YAML.safe_load(ERB.new(File.read(file_path)).result, [], [], true)
config ||= {}
params_for_environment = config[environment.to_s]

Expand Down
3 changes: 3 additions & 0 deletions test/dummy/config/initializers/vanity.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Vanity.configure do |config|
config.config_path = Rails.root.join('config')
end
7 changes: 7 additions & 0 deletions test/dummy/config/vanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default: &default
some_key: true

test:
<<: *default
adapter: mock
collecting: false

0 comments on commit 707c1ac

Please sign in to comment.