aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2009-10-08 10:58:04 -0700
committerCarl Lerche <carllerche@mac.com>2009-10-08 10:58:04 -0700
commit665c7ad29d5614b8f5535d317f1dd2803ddcaa7d (patch)
treea3ccc9fff3c07a5569fa1ef33267c1f3cf679ee6
parent6e7b02b21a65bcf86dbd61d37dcf682e4153bd99 (diff)
downloadrails-665c7ad29d5614b8f5535d317f1dd2803ddcaa7d.tar.gz
rails-665c7ad29d5614b8f5535d317f1dd2803ddcaa7d.tar.bz2
rails-665c7ad29d5614b8f5535d317f1dd2803ddcaa7d.zip
Fix warning spew for 1.9
-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