0
0
Fork 0

Bump chewy from 5.2.0 to 7.2.3 (supports Elasticsearch 7.x) (#16915)

* Bump chewy from 5.2.0 to 7.2.2

* fix style (codeclimate)

* fix style

* fix style

* Bump chewy from 7.2.2 to 7.2.3
This commit is contained in:
Takeshi Umeda 2021-11-19 06:02:08 +09:00 committed by GitHub
parent 2b6a25c609
commit 3419d3ec84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 136 additions and 145 deletions

View file

@ -189,7 +189,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::Status, ids) if Chewy.enabled?
Chewy.strategy.current.update(StatusesIndex, ids) if Chewy.enabled?
Rails.cache.delete_multi(ids.map { |id| "statuses/#{id}" })
favourites.delete_all
end
@ -197,7 +197,7 @@ class DeleteAccountService < BaseService
def purge_bookmarks!
@account.bookmarks.in_batches do |bookmarks|
Chewy.strategy.current.update(StatusesIndex::Status, bookmarks.pluck(:status_id)) if Chewy.enabled?
Chewy.strategy.current.update(StatusesIndex, bookmarks.pluck(:status_id)) if Chewy.enabled?
bookmarks.delete_all
end
end