aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_view/base.rb6
1 files changed, 5 insertions, 1 deletions
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