diff options
Diffstat (limited to 'railties/lib/rails')
-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 |