diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-07 20:59:26 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-07 20:59:26 +0100 |
commit | 19e7c524d2831726a51a973b0dc211725496e9d8 (patch) | |
tree | be58b9cb2762c2707c27f10f1a5d880ec0d70e86 /railties/lib/rails/generators | |
parent | 423e2acbb7110961a2774ccd191261c031b83d7a (diff) | |
download | rails-19e7c524d2831726a51a973b0dc211725496e9d8.tar.gz rails-19e7c524d2831726a51a973b0dc211725496e9d8.tar.bz2 rails-19e7c524d2831726a51a973b0dc211725496e9d8.zip |
Ensure config/application.rb also uses app_const instead of app_name.classify.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/application.rb | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index fc6a3cdee8..2f85a0504e 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -193,8 +193,12 @@ module Rails::Generators @app_name ||= File.basename(destination_root) end + def app_const_base + @app_const_base ||= app_name.gsub(/\W/, '_').squeeze('_').classify + end + def app_const - @app_const ||= "#{app_name.gsub(/\W/, '_').squeeze('_').classify}::Application" + @app_const ||= "#{app_const_base}::Application" end def valid_app_const? diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index dce5b55d86..334820826f 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -1,6 +1,6 @@ require File.expand_path('../boot', __FILE__) -module <%= app_name.classify %> +module <%= app_const_base %> class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers |