From fcce1f17eaf9993b0210fe8e2a8117b61a1f0f69 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 17 Nov 2008 19:16:31 +0100 Subject: BACKWARDS INCOMPATIBLE: Renamed application.rb to application_controller.rb and removed all the special casing that was in place to support the former. You must do this rename in your own application when you upgrade to this version [DHH] --- railties/CHANGELOG | 5 +++++ railties/Rakefile | 2 +- railties/doc/guides/source/layouts_and_rendering.txt | 2 +- railties/helpers/application.rb | 15 --------------- railties/helpers/application_controller.rb | 15 +++++++++++++++ .../generators/applications/app/app_generator.rb | 3 ++- 6 files changed, 24 insertions(+), 18 deletions(-) delete mode 100644 railties/helpers/application.rb create mode 100644 railties/helpers/application_controller.rb (limited to 'railties') diff --git a/railties/CHANGELOG b/railties/CHANGELOG index ae20cb50da..e6b90198ab 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,3 +1,8 @@ +*2.3.0/3.0* + +* BACKWARDS INCOMPATIBLE: Renamed application.rb to application_controller.rb and removed all the special casing that was in place to support the former. You must do this rename in your own application when you upgrade to this version [DHH] + + *2.2.1 [RC2] (November 14th, 2008)* * Fixed plugin generator so that generated unit tests would subclass ActiveSupport::TestCase, also introduced a helper script to reduce the needed require statements #1137 [Mathias Meyer] diff --git a/railties/Rakefile b/railties/Rakefile index 1bc59ac0b0..c9541b0292 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -184,7 +184,7 @@ task :copy_html_files do end task :copy_application do - cp "helpers/application.rb", "#{PKG_DESTINATION}/app/controllers/application.rb" + cp "helpers/application_controller.rb", "#{PKG_DESTINATION}/app/controllers/application_controller.rb" cp "helpers/application_helper.rb", "#{PKG_DESTINATION}/app/helpers/application_helper.rb" end diff --git a/railties/doc/guides/source/layouts_and_rendering.txt b/railties/doc/guides/source/layouts_and_rendering.txt index 2cba53b94c..8f1fae5007 100644 --- a/railties/doc/guides/source/layouts_and_rendering.txt +++ b/railties/doc/guides/source/layouts_and_rendering.txt @@ -313,7 +313,7 @@ With those declarations, the +inventory+ layout would be used only for the +inde Layouts are shared downwards in the hierarchy, and more specific layouts always override more general ones. For example: -+application.rb+: ++application_controller.rb+: [source, ruby] ------------------------------------------------------- diff --git a/railties/helpers/application.rb b/railties/helpers/application.rb deleted file mode 100644 index 0a3ed822a4..0000000000 --- a/railties/helpers/application.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Filters added to this controller apply to all controllers in the application. -# Likewise, all the methods added will be available for all controllers. - -class ApplicationController < ActionController::Base - helper :all # include all helpers, all the time - - # See ActionController::RequestForgeryProtection for details - # Uncomment the :secret if you're not using the cookie session store - protect_from_forgery # :secret => '<%= app_secret %>' - - # See ActionController::Base for details - # Uncomment this to filter the contents of submitted sensitive data parameters - # from your application log (in this case, all fields with names like "password"). - # filter_parameter_logging :password -end diff --git a/railties/helpers/application_controller.rb b/railties/helpers/application_controller.rb new file mode 100644 index 0000000000..0a3ed822a4 --- /dev/null +++ b/railties/helpers/application_controller.rb @@ -0,0 +1,15 @@ +# Filters added to this controller apply to all controllers in the application. +# Likewise, all the methods added will be available for all controllers. + +class ApplicationController < ActionController::Base + helper :all # include all helpers, all the time + + # See ActionController::RequestForgeryProtection for details + # Uncomment the :secret if you're not using the cookie session store + protect_from_forgery # :secret => '<%= app_secret %>' + + # See ActionController::Base for details + # Uncomment this to filter the contents of submitted sensitive data parameters + # from your application log (in this case, all fields with names like "password"). + # filter_parameter_logging :password +end diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index 32c320385d..8c9bc63fc6 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -47,7 +47,8 @@ class AppGenerator < Rails::Generator::Base m.file "README", "README" # Application - m.template "helpers/application.rb", "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest } + m.template "helpers/application_controller.rb", "app/controllers/application_controller.rb", :assigns => { + :app_name => @app_name, :app_secret => md5.hexdigest } m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb" m.template "helpers/test_helper.rb", "test/test_helper.rb" m.template "helpers/performance_test.rb", "test/performance/browsing_test.rb" -- cgit v1.2.3