Skip to content

Commit

Permalink
Added rake rails:update:application_controller to renamed application…
Browse files Browse the repository at this point in the history
….rb to application_controller.rb -- included in rake rails:update so upgrading to 2.3 will automatically trigger it [#1439 state:committed] (kastner)
  • Loading branch information
dhh committed Nov 23, 2008
1 parent 4d2ccbb commit 9e08a3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*2.3.0 [Edge]*

* 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 [kastner]

* Added Rails.backtrace_cleaner as an accessor for the Rails::BacktraceCleaner instance used by the framework to cut down on backtrace noise and config/initializers/backtrace_silencers.rb to add your own (or turn them all off) [DHH]

* Switch from Test::Unit::TestCase to ActiveSupport::TestCase. [Jeremy Kemper]
Expand Down
12 changes: 11 additions & 1 deletion railties/lib/tasks/framework.rake
Expand Up @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit 9e08a3b

Please sign in to comment.