From 50a613d3b7eb824d667c14443f851c9316f18f59 Mon Sep 17 00:00:00 2001 From: "Marcos G. Zimmermann" Date: Fri, 16 Aug 2024 18:35:31 -0300 Subject: [PATCH] feat: backward compatibility for lazy_update_document_attributes and eager_include_document_attributes --- lib/esse/index/documents.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/esse/index/documents.rb b/lib/esse/index/documents.rb index c64167a..b6dc6dc 100644 --- a/lib/esse/index/documents.rb +++ b/lib/esse/index/documents.rb @@ -209,6 +209,10 @@ def import(*repo_types, context: {}, eager_load_lazy_attributes: false, update_l repo_types = repo_hash.keys if repo_types.empty? count = 0 + # Backward compatibility while I change plugins using it + update_lazy_attributes = options.delete(:lazy_update_document_attributes) if options.key?(:lazy_update_document_attributes) + eager_load_lazy_attributes = options.delete(:eager_include_document_attributes) if options.key?(:eager_include_document_attributes) + repo_hash.slice(*repo_types).each do |repo_name, repo| # Elasticsearch 6.x and older have multiple types per index. # This gem supports multiple types per index for backward compatibility, but we recommend to update