Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code in the Reloading module #1268

Open
wants to merge 1 commit into
base: 7.1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 2 additions & 13 deletions lib/neo4j/active_node/labels/reloading.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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