From cd9c309b78de443d2e37760998418616ba34276d Mon Sep 17 00:00:00 2001 From: Pierre Chapuis Date: Sat, 6 Feb 2021 11:03:44 +0100 Subject: [PATCH] deal with `nil` document types in Multimodel --- elasticsearch-model/lib/elasticsearch/model/multimodel.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch-model/lib/elasticsearch/model/multimodel.rb b/elasticsearch-model/lib/elasticsearch/model/multimodel.rb index 2c2306274..f9ef2eaea 100644 --- a/elasticsearch-model/lib/elasticsearch/model/multimodel.rb +++ b/elasticsearch-model/lib/elasticsearch/model/multimodel.rb @@ -85,7 +85,7 @@ def index_name # @return [Array] the list of document types used for retrieving documents # def document_type - models.map { |m| m.document_type } + models.map { |m| m.document_type }.compact.presence end # Get the client common for all models