diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-15 17:32:10 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-15 17:32:10 -0700 |
commit | 3c15cba17519e7a4acc3958662f8f3693837c179 (patch) | |
tree | 9cf370a4ac9da9eee54130633b297209fd9d02d1 | |
parent | 19c3495a671c364e0dc76c276efbcd9dc6914c74 (diff) | |
download | rails-3c15cba17519e7a4acc3958662f8f3693837c179.tar.gz rails-3c15cba17519e7a4acc3958662f8f3693837c179.tar.bz2 rails-3c15cba17519e7a4acc3958662f8f3693837c179.zip |
Whoops, I guess we broke layouts ;)
6 files changed, 7 insertions, 32 deletions
diff --git a/actionpack/lib/action_controller/abstract/layouts.rb b/actionpack/lib/action_controller/abstract/layouts.rb index 9ff8e9beb1..2ac4e6068a 100644 --- a/actionpack/lib/action_controller/abstract/layouts.rb +++ b/actionpack/lib/action_controller/abstract/layouts.rb @@ -9,6 +9,11 @@ module AbstractController end module ClassMethods + def inherited(klass) + super + klass._write_layout_method + end + # Specify the layout to use for this class. # # If the specified layout is a: @@ -78,6 +83,7 @@ module AbstractController end ruby_eval end + self.class_eval { private :_layout } end end diff --git a/actionpack/lib/action_controller/base/base.rb b/actionpack/lib/action_controller/base/base.rb index e8fc153578..e541d24e31 100644 --- a/actionpack/lib/action_controller/base/base.rb +++ b/actionpack/lib/action_controller/base/base.rb @@ -71,12 +71,6 @@ module ActionController @subclasses ||= [] end - def self.app_loaded! - @subclasses.each do |subclass| - subclass.constantize._write_layout_method - end - end - def _normalize_options(action = nil, options = {}, &blk) if action.is_a?(Hash) options, action = action, nil diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb index 05b55216c8..56ec6a6a31 100644 --- a/actionpack/test/abstract_controller/abstract_controller_test.rb +++ b/actionpack/test/abstract_controller/abstract_controller_test.rb @@ -136,11 +136,6 @@ module AbstractController class WithLayouts < PrefixedViews include Layouts - def self.inherited(klass) - klass._write_layout_method - super - end - private def self.layout(formats) begin diff --git a/actionpack/test/abstract_controller/layouts_test.rb b/actionpack/test/abstract_controller/layouts_test.rb index 64c435abb7..37eb55ec98 100644 --- a/actionpack/test/abstract_controller/layouts_test.rb +++ b/actionpack/test/abstract_controller/layouts_test.rb @@ -141,15 +141,6 @@ module AbstractControllerTests end end - # TODO Move to bootloader - AbstractController::Base.descendants.each do |klass| - klass = klass.constantize - next unless klass < AbstractController::Layouts - klass.class_eval do - _write_layout_method - end - end - class TestBase < ActiveSupport::TestCase test "when no layout is specified, and no default is available, render without a layout" do result = Blank.new.process(:index) diff --git a/actionpack/test/new_base/render_text_test.rb b/actionpack/test/new_base/render_text_test.rb index ffc149283b..4a90eaac40 100644 --- a/actionpack/test/new_base/render_text_test.rb +++ b/actionpack/test/new_base/render_text_test.rb @@ -134,6 +134,4 @@ module RenderText assert_status 200 end end -end - -ActionController::Base.app_loaded! +end
\ No newline at end of file diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb index 722dddcfc2..9271b2dd59 100644 --- a/actionpack/test/new_base/test_helper.rb +++ b/actionpack/test/new_base/test_helper.rb @@ -41,15 +41,6 @@ class Rack::TestCase < ActionController::IntegrationTest end ActionController::Routing.use_controllers!(controllers) - - # Move into a bootloader - ActionController::Base.subclasses.each do |klass| - klass = klass.constantize - next unless klass < AbstractController::Layouts - klass.class_eval do - _write_layout_method - end - end end def app |