aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-11-23 13:39:30 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-23 13:39:30 +0100
commit9e08a3bb1d47f79b6953056e72eee58e86d83ead (patch)
tree580239ea9e51653a9305a88a8e395bfed493500f /railties/lib
parent4d2ccbb364b62275bad142d9a0b66ee7fd0c424a (diff)
downloadrails-9e08a3bb1d47f79b6953056e72eee58e86d83ead.tar.gz
rails-9e08a3bb1d47f79b6953056e72eee58e86d83ead.tar.bz2
rails-9e08a3bb1d47f79b6953056e72eee58e86d83ead.zip
Added rake rails:update:application_controller to renamed application.rb to application_controller.rb -- included in rake rails:update so upgrading to 2.3 will automatically trigger it [#1439 state:committed] (kastner)
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/tasks/framework.rake12
1 files changed, 11 insertions, 1 deletions
diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake
index 5d1f8cf945..4cf174b15b 100644
--- a/railties/lib/tasks/framework.rake
+++ b/railties/lib/tasks/framework.rake
@@ -78,7 +78,7 @@ namespace :rails do
end
desc "Update both configs, scripts and public/javascripts from Rails"
- task :update => [ "update:scripts", "update:javascripts", "update:configs" ]
+ task :update => [ "update:scripts", "update:javascripts", "update:configs", "update:application_controller" ]
namespace :update do
desc "Add new scripts to the application script/ directory"
@@ -114,5 +114,15 @@ namespace :rails do
require 'railties_path'
FileUtils.cp(RAILTIES_PATH + '/environments/boot.rb', RAILS_ROOT + '/config/boot.rb')
end
+
+ desc "Rename application.rb to application_controller.rb"
+ task :application_controller do
+ old_style = RAILS_ROOT + '/app/controllers/application.rb'
+ new_style = RAILS_ROOT + '/app/controllers/application_controller.rb'
+ if File.exists?(old_style) && !File.exists?(new_style)
+ FileUtils.mv(old_style, new_style)
+ puts "#{old_style} has been renamed to #{new_style}, update your SCM as necessary"
+ end
+ end
end
end