Permalink
Browse files

Fix warning spew for 1.9

  • Loading branch information...
1 parent 6e7b02b commit 665c7ad29d5614b8f5535d317f1dd2803ddcaa7d Carl Lerche committed Oct 8, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 actionpack/lib/action_view/base.rb
@@ -239,7 +239,11 @@ def self.for_controller(controller)
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

0 comments on commit 665c7ad

Please sign in to comment.