From 8fac2c88cae0f2fd42fad3c2c2c6c860df14d629 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Thu, 14 May 2009 15:30:35 -0700 Subject: Cleaning up more render tests --- actionpack/lib/action_controller/abstract.rb | 3 +++ actionpack/lib/action_controller/abstract/base.rb | 9 +++++++++ actionpack/lib/action_view.rb | 1 + actionpack/lib/action_view/helpers/tag_helper.rb | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/abstract.rb b/actionpack/lib/action_controller/abstract.rb index 3f5c4a185f..48e33282ec 100644 --- a/actionpack/lib/action_controller/abstract.rb +++ b/actionpack/lib/action_controller/abstract.rb @@ -1,3 +1,6 @@ +require "active_support/core_ext/module/attr_internal" +require "active_support/core_ext/module/delegation" + module AbstractController autoload :Base, "action_controller/abstract/base" autoload :Callbacks, "action_controller/abstract/callbacks" diff --git a/actionpack/lib/action_controller/abstract/base.rb b/actionpack/lib/action_controller/abstract/base.rb index c9e1081b23..8f2bfb5711 100644 --- a/actionpack/lib/action_controller/abstract/base.rb +++ b/actionpack/lib/action_controller/abstract/base.rb @@ -23,6 +23,15 @@ module AbstractController end alias_method :abstract?, :abstract + + def inherited(klass) + ::AbstractController::Base.subclasses << klass.to_s + super + end + + def subclasses + @subclasses ||= [] + end def internal_methods controller = self diff --git a/actionpack/lib/action_view.rb b/actionpack/lib/action_view.rb index c3786af439..94138097e3 100644 --- a/actionpack/lib/action_view.rb +++ b/actionpack/lib/action_view.rb @@ -24,6 +24,7 @@ activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" $:.unshift activesupport_path if File.directory?(activesupport_path) require 'active_support' +require 'active_support/core_ext/class/attribute_accessors' require File.join(File.dirname(__FILE__), "action_pack") diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index af8c4d5e21..66d7592874 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -9,7 +9,7 @@ module ActionView include ERB::Util BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple checked).to_set - BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map(&:to_sym)) + BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map {|attr| attr.to_sym }) # Returns an empty HTML tag of type +name+ which by default is XHTML # compliant. Set +open+ to true to create an open tag compatible -- cgit v1.2.3