aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/generators/rails')
-rw-r--r--railties/lib/generators/rails/app/app_generator.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/lib/generators/rails/app/app_generator.rb b/railties/lib/generators/rails/app/app_generator.rb
index 92e0d37436..888e3b2ddd 100644
--- a/railties/lib/generators/rails/app/app_generator.rb
+++ b/railties/lib/generators/rails/app/app_generator.rb
@@ -220,6 +220,8 @@ module Rails::Generators
raise Error, "Invalid application name #{app_name}. Please give a name which does not start with numbers."
elsif RESERVED_NAMES.include?(app_name)
raise Error, "Invalid application name #{app_name}. Please give a name which does not match one of the reserved rails words."
+ elsif Object.const_defined?(app_const_base)
+ raise Error, "Invalid application name #{app_name}, constant #{app_const_base} is already in use. Please choose another application name."
end
end