From bfde624f1c3a36efaa01d94850f97a07f6d39b4b Mon Sep 17 00:00:00 2001 From: Yurie Nagorny Date: Wed, 3 Mar 2021 14:14:20 -0500 Subject: [PATCH] Update for backward compatibility with older ruby --- lib/mongoid/multitenancy/document.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mongoid/multitenancy/document.rb b/lib/mongoid/multitenancy/document.rb index e04431e..2b45d90 100644 --- a/lib/mongoid/multitenancy/document.rb +++ b/lib/mongoid/multitenancy/document.rb @@ -87,7 +87,7 @@ def validates_tenancy_of(*args) # Redefine 'index' to include the tenant field in first position def index(spec, options = nil) - super_options = options.dup || {} + super_options = (options || {}).dup full_index = super_options.delete(:full_index) if full_index.nil? ? tenant_options[:full_indexes] : full_index spec = { tenant_field => 1 }.merge(spec)