From 4e475df8ecb0bc06384f468d1c4eacd74a21c5c6 Mon Sep 17 00:00:00 2001 From: Brian Underwood Date: Mon, 15 Aug 2016 12:24:11 +0200 Subject: [PATCH] Remove code in the Reloading module and replace with the same resetting behavior that we use in the specs --- lib/neo4j/active_node/labels/reloading.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/neo4j/active_node/labels/reloading.rb b/lib/neo4j/active_node/labels/reloading.rb index 67cbefdf1..f824afb46 100644 --- a/lib/neo4j/active_node/labels/reloading.rb +++ b/lib/neo4j/active_node/labels/reloading.rb @@ -2,20 +2,9 @@ module Neo4j::ActiveNode::Labels module Reloading extend ActiveSupport::Concern - MODELS_TO_RELOAD = [] - def self.reload_models! - MODELS_TO_RELOAD.each(&:constantize) - MODELS_TO_RELOAD.clear - end - - module ClassMethods - def before_remove_const - associations.each_value(&:queue_model_refresh!) - MODELS_FOR_LABELS_CACHE.clear - WRAPPED_CLASSES.each { |c| MODELS_TO_RELOAD << c.name } - WRAPPED_CLASSES.clear - end + Neo4j::ActiveNode::Labels::WRAPPED_CLASSES.clear + Neo4j::ActiveNode::Labels.clear_wrapped_models end end end