diff options
author | Fred Wu <ifredwu@gmail.com> | 2010-08-25 11:36:07 +1000 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-08-28 17:54:53 -0300 |
commit | 83f4507cf153ea6081dd70326f5f3a0331cc167e (patch) | |
tree | b2e41589c1e8e68b9ba0f8ba5290f55a61b754d6 /railties/lib | |
parent | 3e22e0b0250e1386f68ebbdb7f23ae10888f5da6 (diff) | |
download | rails-83f4507cf153ea6081dd70326f5f3a0331cc167e.tar.gz rails-83f4507cf153ea6081dd70326f5f3a0331cc167e.tar.bz2 rails-83f4507cf153ea6081dd70326f5f3a0331cc167e.zip |
Fixed the session name generated by the app_generator. Also refactored the corresponding test suites to be cleaner. [#5434 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 6eba0f77e7..cdff1743ff 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -355,6 +355,8 @@ module Rails def app_name @app_name ||= File.basename(destination_root) end + + alias_method :defined_app_name, :app_name def defined_app_const_base Rails.respond_to?(:application) && defined?(Rails::Application) && @@ -362,6 +364,7 @@ module Rails end def app_const_base + defined_app_name # ensures the correct app_name if it's already defined @app_const_base ||= defined_app_const_base || app_name.gsub(/\W/, '_').squeeze('_').camelize end |