Underscore the app_name before classifying it.

Fixes invalid constant if your app name has a dash in it.
'rails-upgrade'.classify # => Rails-upgrade
'rails-upgrade'.underscore.classify # => RailsUpgrade
This commit is contained in:
Jesse Storimer 2010-02-06 01:59:59 +08:00 committed by Jeremy McAnally
parent e08de4f169
commit ce22c72ee8
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ module Rails
r.to_route_code
end.join("\n")
"#{app_name.classify}::Application.routes.draw do\n#{@new_code}\nend\n"
"#{app_name.underscore.classify}::Application.routes.draw do\n#{@new_code}\nend\n"
end
private