From a2a31f1826c47a4a28d6c918bf3c7adbe09c394a Mon Sep 17 00:00:00 2001 From: Weston Triemstra Date: Tue, 21 Jul 2015 12:46:27 -0700 Subject: [PATCH] Addresses class caching problem where classes were not being reloaded properly when rails reloaded changed code. It was leading to this issue in devise-neo4j: https://github.com/neo4jrb/devise-neo4j/issues/16 --- lib/neo4j/railtie.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/neo4j/railtie.rb b/lib/neo4j/railtie.rb index 0dc2b2106..0ef3cb8ee 100644 --- a/lib/neo4j/railtie.rb +++ b/lib/neo4j/railtie.rb @@ -93,6 +93,10 @@ def register_neo4j_cypher_logging register_neo4j_cypher_logging if Neo4j::Config[:log_cypher_queries] end + config.to_prepare do + Neo4j::ActiveNode::Labels::MODELS_FOR_LABELS_CACHE.clear + end + console do register_neo4j_cypher_logging end