diff options
-rw-r--r-- | railties/lib/rails_generator/commands.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb index 03b7d354a6..08ecbfb5cf 100644 --- a/railties/lib/rails_generator/commands.rb +++ b/railties/lib/rails_generator/commands.rb @@ -380,12 +380,14 @@ HELP # Thanks to Florian Gross (flgr). def raise_class_collision(class_name) message = <<end_message - The name '#{class_name}' is reserved by Ruby on Rails. + The name '#{class_name}' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again. end_message if suggest = find_synonyms(class_name) - message << "\n Suggestions: \n\n" - message << suggest.join("\n") + if suggest.any? + message << "\n Suggestions: \n\n" + message << suggest.join("\n") + end end raise UsageError, message end |