From 665c7ad29d5614b8f5535d317f1dd2803ddcaa7d Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 8 Oct 2009 10:58:04 -0700 Subject: [PATCH] Fix warning spew for 1.9 --- actionpack/lib/action_view/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 5a4e1bee43..82b419d846 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -239,7 +239,11 @@ module ActionView #:nodoc: name = controller.class.name.gsub(/::/, '__') Subclasses.class_eval do - remove_const(name) if const_defined?(name) + if method(:const_defined?).arity == 1 + remove_const(name) if const_defined?(name) # Ruby 1.8.x + else + remove_const(name) if const_defined?(name, false) # Ruby 1.9.x + end const_set(name, self) end