public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
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]
dhh (author)
Mon Nov 17 10:16:31 -0800 2008
commit  fcce1f17eaf9993b0210fe8e2a8117b61a1f0f69
tree    dcf89fab841f873dd9c26b3f061f7d1c4e378f86
parent  4b33fae1f52325d22083de2e83d827b924d1c616
...
12
13
14
15
16
17
18
19
20
21
22
 
23
24
25
...
12
13
14
 
 
 
 
 
 
 
 
15
16
17
18
0
@@ -12,14 +12,7 @@ module ActionController
0
           after_dispatch :cleanup_application
0
         end
0
 
0
-        # Common callbacks
0
-        to_prepare :load_application_controller do
0
-          begin
0
-            require_dependency 'application' unless defined?(::ApplicationController)
0
-          rescue LoadError => error
0
-            raise unless error.message =~ /application\.rb/
0
-          end
0
-        end
0
+        to_prepare(:load_application_controller) { ApplicationController }
0
 
0
         if defined?(ActiveRecord)
0
           after_dispatch :checkin_connections
...
314
315
316
317
318
319
320
321
 
322
323
324
...
314
315
316
 
 
 
 
 
317
318
319
320
0
@@ -314,11 +314,7 @@ module ActiveSupport #:nodoc:
0
         nesting = nesting[1..-1] if nesting && nesting[0] == ?/
0
         next if nesting.blank?
0
 
0
-        [
0
-          nesting.camelize,
0
-          # Special case: application.rb might define ApplicationControlller.
0
-          ('ApplicationController' if nesting == 'application')
0
-        ]
0
+        [ nesting.camelize ]
0
       end.flatten.compact.uniq
0
     end
0
 
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+*2.3.0/3.0*
0
+
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]
0
+
0
+
0
 *2.2.1 [RC2] (November 14th, 2008)*
0
 
0
 * 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]
...
184
185
186
187
 
188
189
190
...
184
185
186
 
187
188
189
190
0
@@ -184,7 +184,7 @@ task :copy_html_files do
0
 end
0
 
0
 task :copy_application do
0
-  cp "helpers/application.rb", "#{PKG_DESTINATION}/app/controllers/application.rb"
0
+  cp "helpers/application_controller.rb", "#{PKG_DESTINATION}/app/controllers/application_controller.rb"
0
   cp "helpers/application_helper.rb", "#{PKG_DESTINATION}/app/helpers/application_helper.rb"
0
 end
0
 
...
313
314
315
316
 
317
318
319
...
313
314
315
 
316
317
318
319
0
@@ -313,7 +313,7 @@ With those declarations, the +inventory+ layout would be used only for the +inde
0
 
0
 Layouts are shared downwards in the hierarchy, and more specific layouts always override more general ones. For example:
0
 
0
-+application.rb+:
0
++application_controller.rb+:
0
 
0
 [source, ruby]
0
 -------------------------------------------------------
...
47
48
49
50
 
 
51
52
53
...
47
48
49
 
50
51
52
53
54
0
@@ -47,7 +47,8 @@ class AppGenerator < Rails::Generator::Base
0
       m.file "README",         "README"
0
 
0
       # Application
0
-      m.template "helpers/application.rb",        "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest }
0
+      m.template "helpers/application_controller.rb", "app/controllers/application_controller.rb", :assigns => { 
0
+        :app_name => @app_name, :app_secret => md5.hexdigest }
0
       m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb"
0
       m.template "helpers/test_helper.rb",        "test/test_helper.rb"
0
       m.template "helpers/performance_test.rb",   "test/performance/browsing_test.rb"

Comments

ncr Mon Nov 17 11:32:22 -0800 2008

Saw that coming ;)

tilsammans Mon Nov 17 11:35:10 -0800 2008

Makes sense for 3.0, not sure about 2.3 though.

ryanb Mon Nov 17 11:49:28 -0800 2008

Maybe still load application.rb if it exists and spit out a deprecation notice? That way there can be a transitioning version.

topfunky Mon Nov 17 13:33:26 -0800 2008

I remember way back when…”ApplicationController” was just called “Application.”

Those were the days.

drnic Mon Nov 17 13:38:07 -0800 2008

+1 ryanb

guillaumegentil Mon Nov 17 14:29:16 -0800 2008

great!

giraffesoft Mon Nov 17 14:42:28 -0800 2008

yay!

sethladd Mon Nov 17 14:52:50 -0800 2008

This should be a 3.0 change, imo.

foca Mon Nov 17 14:54:10 -0800 2008

+1 ryanb phase this change in gradually =)

spicycode Mon Nov 17 15:22:21 -0800 2008

Finally!

j4s0n Mon Nov 17 16:59:59 -0800 2008

that makes more sense.

adkron Mon Nov 17 18:39:35 -0800 2008

+1 for ryanb. Any big api change should at lease get some deprecation warning and isn’t this a little much for a minor release.

lifo Mon Nov 17 19:15:00 -0800 2008

We haven’t really decided if 2.2.next will be 2.3 or 3.0. Also, ‘rake rails:update’ task should/will take care of renaming application.rb -> application_controller.rb.

boblmartens Mon Nov 17 19:23:06 -0800 2008

Isn’t 2.3 going to be released as 3.0? I thought that is how it worked. 1.2.x lead to 2.0.x … so 2.2.x will give way to 3.0.x!

Regardless, keep up the good work!

radar Mon Nov 17 19:47:41 -0800 2008

I remember when this was being discussed. Glad to see it finally making its way into core!

broney Tue Nov 18 00:16:26 -0800 2008

I don’t see this being a problem as a 2.3 release – it’s a single file name change, it’s not as if there’s a change to a major API function.

NZKoz Tue Nov 18 01:58:27 -0800 2008

When this gets pushed into a release we’ll naturally take care to make the upgrade path as smooth as possible.

However, if you’re tracking edge right now, just after a branch, you’re braver than I am :)

labria Tue Nov 18 03:45:41 -0800 2008

At last!

divineforest Tue Nov 18 03:49:16 -0800 2008

1+ for ranaming

geoffgarside Tue Nov 18 04:36:35 -0800 2008

Anyone else getting an ActionController::MethodNotAllowed when visiting / since this?

geoffgarside Tue Nov 18 05:03:24 -0800 2008

nm its unrelated, seems map.root is generating me a POST rather than a GET route :S

ryanb Tue Nov 18 08:33:55 -0800 2008

I still think a transitioning version (where application.rb is loaded and deprecated) would be nice. Not for development (it’s easy enough to rename a file), but for deployment in production. Now you’ll have to push this change to the server the exact same time you upgrade Rails. Having a stepping-stone version where both application.rb and application_controller.rb work would ease this transition.

ryanb Tue Nov 18 08:39:05 -0800 2008

After thinking about it a bit more I suppose it’s not as big of an issue. It’s easy enough to make a second branch, change the gem version in the config, fix all the problems, and then deploy that all to the server in one go.

NZKoz Tue Nov 18 09:30:17 -0800 2008

@ryanb: 2.2.something could end up being the transitioning version you’re talking about, or we could add the deprecation / warnings into master.

Again, this isn’t how we’re going to ship anything, and chasing edge is risky, especially this soon after a branch where we have a bunch of features / patches we pushed out as ‘too risky’.

NZKoz Tue Nov 18 09:30:57 -0800 2008

@topfunky: oh yeah, well I remember abstract_application_controller.rb. Take that!

lb Tue Nov 18 15:47:48 -0800 2008

abstract_application_controller.rb! whoa

evilgeenius Wed Nov 19 07:18:01 -0800 2008

My only problem with calling it application_controller is that it indicates that it is a controller in MVC, which it isn’t. It has features that all other controllers share.

ryanb Wed Nov 19 08:33:42 -0800 2008

@evilgeenius the class has been called ApplicationController for quite some time. This patch just makes the file name consistent with the class name. Consistency is a good thing.

jamieorc Wed Nov 19 10:32:31 -0800 2008

huzzah!

evilgeenius Thu Nov 20 06:26:40 -0800 2008

@ryanb i concede

whatcould Sun Nov 23 10:35:01 -0800 2008

With this commit you’ll need to update your phusion passenger—but it might be better to hack the solution yourself than try to be fancy and update the gem.

See my note in comments at http://ryandaigle.com/articles/2008/11/19/what-s-new-in-edge-rails-application-rb-duality-is-no-more