From 01b1a8772928fbf31180341356981b95d0581413 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 29 Jan 2006 00:37:39 +0000 Subject: Added reusable reloading support through the inclusion of the Relodable module that all subclasses of ActiveRecord::Base, ActiveRecord::Observer, ActiveController::Base, and ActionMailer::Base automatically gets [DHH]. Added auto-loading support for classes in modules, so Conductor::Migration will look for conductor/migration.rb and Conductor::Database::Settings will look for conductor/database/settings.rb [Nicholas Seckar]. Refactored extensions to module, class, and object in active support [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/layout.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller/layout.rb') diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index cc153c45a7..f2a5b97bf1 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -1,16 +1,16 @@ module ActionController #:nodoc: module Layout #:nodoc: - def self.append_features(base) - super + def self.included(base) + base.extend(ClassMethods) base.class_eval do alias_method :render_with_no_layout, :render alias_method :render, :render_with_a_layout class << self alias_method :inherited_without_layout, :inherited + alias_method :inherited, :inherited_with_layout end end - base.extend(ClassMethods) end # Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in @@ -172,8 +172,9 @@ module ActionController #:nodoc: end private - def inherited(child) + def inherited_with_layout(child) inherited_without_layout(child) + child.send :include, Reloadable layout_match = child.name.underscore.sub(/_controller$/, '') child.layout(layout_match) unless layout_list.grep(%r{layouts/#{layout_match}\.[a-z][0-9a-z]*$}).empty? end -- cgit v1.2.3