diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-06-11 15:59:23 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-06-14 12:10:17 +0300 |
commit | 6673cf7071094e87d473459452a2d0e4c2ccfebe (patch) | |
tree | 926d5c944b8fd71c1fa2db6ddbc5fc397722112e /railties/lib/rails/generators | |
parent | 326914dd3a15e04851c9ef4a47edeb3dad2ec381 (diff) | |
download | rails-6673cf7071094e87d473459452a2d0e4c2ccfebe.tar.gz rails-6673cf7071094e87d473459452a2d0e4c2ccfebe.tar.bz2 rails-6673cf7071094e87d473459452a2d0e4c2ccfebe.zip |
Use `require_relative` instead of `require` with full path
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/test/test_helper.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb index 7568af5b5e..6ad1f11781 100644 --- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb +++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb @@ -1,4 +1,4 @@ -require File.expand_path('../config/environment', __dir__) +require_relative '../config/environment' require 'rails/test_help' class ActiveSupport::TestCase diff --git a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb index 32e8202e1c..c281fc42ca 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb +++ b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb @@ -1,4 +1,4 @@ -require File.expand_path("../<%= options[:dummy_path] -%>/config/environment.rb", __dir__) +require_relative "<%= File.join('..', options[:dummy_path], 'config/environment') -%>" <% unless options[:skip_active_record] -%> ActiveRecord::Migrator.migrations_paths = [File.expand_path("../<%= options[:dummy_path] -%>/db/migrate", __dir__)] <% if options[:mountable] -%> |