Skip to content

Commit 48bf7f0

Browse files
committed
Fixed soft_deprecate warnings in meilisearch-ruby
1 parent 5b57c6b commit 48bf7f0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/meilisearch-rails.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,14 @@ def ms_index!(document, synchronous = false)
567567
doc = doc.merge ms_pk(options) => primary_key
568568

569569
if synchronous || options[:synchronous]
570-
index.add_documents!(doc)
570+
index.add_documents(doc).await
571571
else
572572
index.add_documents(doc)
573573
end
574574
elsif ms_conditional_index?(options) && primary_key.present?
575575
# remove non-indexable documents
576576
if synchronous || options[:synchronous]
577-
index.delete_document!(primary_key)
577+
index.delete_document(primary_key).await
578578
else
579579
index.delete_document(primary_key)
580580
end
@@ -606,7 +606,7 @@ def ms_remove_from_index!(document, synchronous = false)
606606

607607
index = ms_ensure_init(options, settings)
608608
if synchronous || options[:synchronous]
609-
index.delete_document!(primary_key)
609+
index.delete_document(primary_key).await
610610
else
611611
index.delete_document(primary_key)
612612
end
@@ -619,7 +619,7 @@ def ms_clear_index!(synchronous = false)
619619
next if ms_indexing_disabled?(options)
620620

621621
index = ms_ensure_init(options, settings)
622-
synchronous || options[:synchronous] ? index.delete_all_documents! : index.delete_all_documents
622+
synchronous || options[:synchronous] ? index.delete_all_documents.await : index.delete_all_documents
623623
@ms_indexes[MeiliSearch::Rails.active?][settings] = nil
624624
end
625625
nil

lib/meilisearch/rails/ms_clean_up_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def perform(documents)
88
index = MeiliSearch::Rails.client.index(document[:index_uid])
99

1010
if document[:synchronous]
11-
index.delete_document!(document[:primary_key])
11+
index.delete_document(document[:primary_key]).await
1212
else
1313
index.delete_document(document[:primary_key])
1414
end

spec/system/tech_shop_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@
122122

123123
context 'when a document cannot be found in ActiveRecord' do
124124
it 'does not throw an exception' do
125-
Product.index.add_documents!(@palmpre.attributes.merge(id: -1))
125+
Product.index.add_documents(@palmpre.attributes.merge(id: -1)).await
126126
expect { Product.search('pal') }.not_to raise_error
127-
Product.index.delete_document!(-1)
127+
Product.index.delete_document(-1).await
128128
end
129129

130130
it 'returns other available results' do
131-
Product.index.add_documents!(@palmpre.attributes.merge(id: -1))
131+
Product.index.add_documents(@palmpre.attributes.merge(id: -1)).await
132132
expect(Product.search('pal').size).to eq(2)
133-
Product.index.delete_document!(-1)
133+
Product.index.delete_document(-1).await
134134
end
135135
end
136136

0 commit comments

Comments
 (0)