From 06a1bcbaf6f98363382a7c2b26d267889324de5a Mon Sep 17 00:00:00 2001 From: Michael Deryugin Date: Wed, 28 Aug 2024 12:43:45 +0100 Subject: [PATCH] check name only for Mongoid::Documents classes in Mongoid adapter --- lib/pickle/adapters/mongoid.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pickle/adapters/mongoid.rb b/lib/pickle/adapters/mongoid.rb index 6132e2ba..8c59189e 100644 --- a/lib/pickle/adapters/mongoid.rb +++ b/lib/pickle/adapters/mongoid.rb @@ -13,7 +13,7 @@ def self.except_classes # Gets a list of the available models for this adapter def self.model_classes ObjectSpace.each_object(Class).to_a.select do |klass| - klass.name && klass.ancestors.include?(Mongoid::Document) + klass.ancestors.include?(Mongoid::Document) && klass.name end end