From 85ec5484f71c44be3021c687a85867bb0bb9a968 Mon Sep 17 00:00:00 2001 From: Kouhei Yanagita Date: Thu, 18 Nov 2010 18:22:58 +0900 Subject: [PATCH] ActiveSupport::Dependencies.remove_constant should delete cached result. --- activesupport/lib/active_support/dependencies.rb | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 787437c..9d35043 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -538,6 +538,10 @@ module ActiveSupport #:nodoc: @@constants[@name] end + def self.delete(name) + @@constants.delete(name) + end + def self.clear! @@constants.clear end @@ -644,6 +648,7 @@ module ActiveSupport #:nodoc: constantized = constantize(const) constantized.before_remove_const if constantized.respond_to?(:before_remove_const) parent.instance_eval { remove_const to_remove } + Reference.delete(const) return true end -- 1.5.6.5