diff --git a/padrino-core/lib/padrino-core/reloader.rb b/padrino-core/lib/padrino-core/reloader.rb index f17378766..82252b672 100644 --- a/padrino-core/lib/padrino-core/reloader.rb +++ b/padrino-core/lib/padrino-core/reloader.rb @@ -113,6 +113,7 @@ def remove_constant(const) return if constant_excluded?(const) base, _, object = const.to_s.rpartition('::') base = base.empty? ? Object : base.constantize + return unless base.const_get(object).equal?(const) base.send :remove_const, object logger.devel "Removed constant #{const} from #{base}" rescue NameError