1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix warning spew for 1.9

This commit is contained in:
Carl Lerche 2009-10-08 10:58:04 -07:00
parent 6e7b02b21a
commit 665c7ad29d

View file

@ -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