diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-09-20 16:02:39 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-09-20 16:30:18 +0900 |
commit | 2e8146909a08d802f6fb138e666593d7a0887d18 (patch) | |
tree | c695ba481b55afebdd180320e54dd06aff397fed | |
parent | 26aa1b58b0e9451d15a0ee32da3c004d44e5a356 (diff) | |
download | rails-2e8146909a08d802f6fb138e666593d7a0887d18.tar.gz rails-2e8146909a08d802f6fb138e666593d7a0887d18.tar.bz2 rails-2e8146909a08d802f6fb138e666593d7a0887d18.zip |
fix application_controller require_dependency path generated by the scaffold generator
This is follow up to #6643.
In #6643, the controller generator only had been fixed, in this commit to fix the scaffold generator.
-rw-r--r-- | railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/namespaced_generators_test.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb index 2c3b04043f..f73e9a96ba 100644 --- a/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +++ b/railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb @@ -1,5 +1,5 @@ <% if namespaced? -%> -require_dependency "<%= namespaced_file_path %>/application_controller" +require_dependency "<%= namespaced_path %>/application_controller" <% end -%> <% module_namespacing do -%> diff --git a/railties/test/generators/namespaced_generators_test.rb b/railties/test/generators/namespaced_generators_test.rb index e839b67960..c4ee6602c5 100644 --- a/railties/test/generators/namespaced_generators_test.rb +++ b/railties/test/generators/namespaced_generators_test.rb @@ -281,6 +281,7 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase # Controller assert_file "app/controllers/test_app/admin/roles_controller.rb" do |content| assert_match(/module TestApp\n class Admin::RolesController < ApplicationController/, content) + assert_match(%r(require_dependency "test_app/application_controller"), content) end assert_file "test/controllers/test_app/admin/roles_controller_test.rb", |