mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Whoops, I guess we broke layouts ;)
This commit is contained in:
parent
19c3495a67
commit
3c15cba175
6 changed files with 7 additions and 32 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -134,6 +134,4 @@ module RenderText
|
|||
assert_status 200
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActionController::Base.app_loaded!
|
||||
end
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue