diff options
author | Matthew Draper <matthew@trebex.net> | 2017-06-15 02:45:38 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 02:45:38 +0930 |
commit | 4915bfeeea88889341153cad9166090c2d6b1910 (patch) | |
tree | 926d5c944b8fd71c1fa2db6ddbc5fc397722112e /railties/lib | |
parent | 326914dd3a15e04851c9ef4a47edeb3dad2ec381 (diff) | |
parent | 6673cf7071094e87d473459452a2d0e4c2ccfebe (diff) | |
download | rails-4915bfeeea88889341153cad9166090c2d6b1910.tar.gz rails-4915bfeeea88889341153cad9166090c2d6b1910.tar.bz2 rails-4915bfeeea88889341153cad9166090c2d6b1910.zip |
Merge pull request #29417 from bogdanvlviv/use-require_relative-instead-of_require-with-full-path
Use `require_relative` instead of `require` with full path
Diffstat (limited to 'railties/lib')
-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] -%> |