diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-12-24 15:53:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-24 15:53:26 +0100 |
commit | ba0b79fc5c698b3d2ca4849bc3a711c75bd76d22 (patch) | |
tree | 3e6743f3a12edc524f2dbb1319835b2a9e73a7a9 | |
parent | 7e6d3a7d9ad3343c7147032fef50bf1cc308a872 (diff) |
Fix undefined method error when batch-removing statuses with ElasticSearch on (#15421)
-rw-r--r-- | app/services/batched_remove_status_service.rb | 2 | ||||
-rw-r--r-- | app/services/delete_account_service.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/services/batched_remove_status_service.rb b/app/services/batched_remove_status_service.rb index 5000062e4..b54bcae35 100644 --- a/app/services/batched_remove_status_service.rb +++ b/app/services/batched_remove_status_service.rb @@ -31,7 +31,7 @@ class BatchedRemoveStatusService < BaseService # Since we skipped all callbacks, we also need to manually # deindex the statuses - Chewy.strategy.current.update(StatusesIndex, statuses_and_reblogs) if Chewy.enabled? + Chewy.strategy.current.update(StatusesIndex::Status, statuses_and_reblogs) if Chewy.enabled? return if options[:skip_side_effects] diff --git a/app/services/delete_account_service.rb b/app/services/delete_account_service.rb index f8154cc3e..802799ccd 100644 --- a/app/services/delete_account_service.rb +++ b/app/services/delete_account_service.rb @@ -187,7 +187,7 @@ class DeleteAccountService < BaseService @account.favourites.in_batches do |favourites| ids = favourites.pluck(:status_id) StatusStat.where(status_id: ids).update_all('favourites_count = GREATEST(0, favourites_count - 1)') - Chewy.strategy.current.update(StatusesIndex, ids) if Chewy.enabled? + Chewy.strategy.current.update(StatusesIndex::Status, ids) if Chewy.enabled? # Rails.cache.delete_multi would be better, but we don't have it yet ids.each { |id| Rails.cache.delete("statuses/#{id}") } favourites.delete_all @@ -196,7 +196,7 @@ class DeleteAccountService < BaseService def purge_bookmarks! @account.bookmarks.in_batches do |bookmarks| - Chewy.strategy.current.update(StatusesIndex, bookmarks.pluck(:status_id)) if Chewy.enabled? + Chewy.strategy.current.update(StatusesIndex::Status, bookmarks.pluck(:status_id)) if Chewy.enabled? bookmarks.delete_all end end |