From 707c1ac0a1bc5f1087656a8db83813c9f00301c1 Mon Sep 17 00:00:00 2001 From: Mark Frost Date: Mon, 7 Mar 2022 08:44:14 +0500 Subject: [PATCH] Enabled aliases for vanity.yml config file (#381) --- lib/vanity/configuration.rb | 2 +- test/dummy/config/initializers/vanity.rb | 3 +++ test/dummy/config/vanity.yml | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/dummy/config/initializers/vanity.rb create mode 100644 test/dummy/config/vanity.yml diff --git a/lib/vanity/configuration.rb b/lib/vanity/configuration.rb index 3cfb1a52..b07101dc 100644 --- a/lib/vanity/configuration.rb +++ b/lib/vanity/configuration.rb @@ -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] diff --git a/test/dummy/config/initializers/vanity.rb b/test/dummy/config/initializers/vanity.rb new file mode 100644 index 00000000..f7870460 --- /dev/null +++ b/test/dummy/config/initializers/vanity.rb @@ -0,0 +1,3 @@ +Vanity.configure do |config| + config.config_path = Rails.root.join('config') +end diff --git a/test/dummy/config/vanity.yml b/test/dummy/config/vanity.yml new file mode 100644 index 00000000..da219ca0 --- /dev/null +++ b/test/dummy/config/vanity.yml @@ -0,0 +1,7 @@ +default: &default + some_key: true + +test: + <<: *default + adapter: mock + collecting: false