diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-05-22 01:40:51 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-05-22 01:40:51 -0700 |
commit | 29d17d3ab65633695babc9123463c78248e41a67 (patch) | |
tree | 2c0dd5f07d45d2e4dd622bd58a1b769a561f19aa /railties/lib/rails/generators | |
parent | d22859ed9712cfa27b83225d8363d0f92261335a (diff) | |
download | rails-29d17d3ab65633695babc9123463c78248e41a67.tar.gz rails-29d17d3ab65633695babc9123463c78248e41a67.tar.bz2 rails-29d17d3ab65633695babc9123463c78248e41a67.zip |
Use require_dependency in generated controllers
Using require in development mode will prevent required files from
reloading, even if they're changed. In order to keep namespaced
application_controller reloadable, we need to use require_dependency
instead of require.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/controller/templates/controller.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/controller/templates/controller.rb b/railties/lib/rails/generators/rails/controller/templates/controller.rb index 9b04192126..ece6bbba3b 100644 --- a/railties/lib/rails/generators/rails/controller/templates/controller.rb +++ b/railties/lib/rails/generators/rails/controller/templates/controller.rb @@ -1,5 +1,5 @@ <% if namespaced? -%> -require "<%= namespaced_file_path %>/application_controller" +require_dependency "<%= namespaced_file_path %>/application_controller" <% end -%> <% module_namespacing do -%> 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 5cd31bf2ee..0294bde582 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 "<%= namespaced_file_path %>/application_controller" +require_dependency "<%= namespaced_file_path %>/application_controller" <% end -%> <% module_namespacing do -%> |