diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-12-10 17:38:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-10 17:38:47 -0500 |
commit | b3108275064353390848056bf097809743dcdf21 (patch) | |
tree | 0b7e1eac9ffb2cf2871b91f600cff765c33b28a0 /activerecord/test | |
parent | 10457475b9fe2ae9dc4e7f932fd6e561416c3881 (diff) | |
parent | 3b7a4d3d75329d499d817c3fbeb75caefe9691ce (diff) | |
download | rails-b3108275064353390848056bf097809743dcdf21.tar.gz rails-b3108275064353390848056bf097809743dcdf21.tar.bz2 rails-b3108275064353390848056bf097809743dcdf21.zip |
Merge pull request #34666 from vinistock/upgrade_rubocop_and_fix_offenses
Upgrade Rubocop to 0.61.1 and fix offenses
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/support/config.rb | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/activerecord/test/support/config.rb b/activerecord/test/support/config.rb index bd6d5c339b..de0d90a18f 100644 --- a/activerecord/test/support/config.rb +++ b/activerecord/test/support/config.rb @@ -13,34 +13,34 @@ module ARTest private - def config_file - Pathname.new(ENV["ARCONFIG"] || TEST_ROOT + "/config.yml") - end - - def read_config - unless config_file.exist? - FileUtils.cp TEST_ROOT + "/config.example.yml", config_file + def config_file + Pathname.new(ENV["ARCONFIG"] || TEST_ROOT + "/config.yml") end - erb = ERB.new(config_file.read) - expand_config(YAML.parse(erb.result(binding)).transform) - end + def read_config + unless config_file.exist? + FileUtils.cp TEST_ROOT + "/config.example.yml", config_file + end - def expand_config(config) - config["connections"].each do |adapter, connection| - dbs = [["arunit", "activerecord_unittest"], ["arunit2", "activerecord_unittest2"], - ["arunit_without_prepared_statements", "activerecord_unittest"]] - dbs.each do |name, dbname| - unless connection[name].is_a?(Hash) - connection[name] = { "database" => connection[name] } - end + erb = ERB.new(config_file.read) + expand_config(YAML.parse(erb.result(binding)).transform) + end - connection[name]["database"] ||= dbname - connection[name]["adapter"] ||= adapter + def expand_config(config) + config["connections"].each do |adapter, connection| + dbs = [["arunit", "activerecord_unittest"], ["arunit2", "activerecord_unittest2"], + ["arunit_without_prepared_statements", "activerecord_unittest"]] + dbs.each do |name, dbname| + unless connection[name].is_a?(Hash) + connection[name] = { "database" => connection[name] } + end + + connection[name]["database"] ||= dbname + connection[name]["adapter"] ||= adapter + end end - end - config - end + config + end end end |