Scope clear_search_records to the account being destroyed (#2847)
Account::Searchable#clear_search_records called Search::Record.for(id).destroy_all which deleted every row in the shard's table, wiping search records belonging to every other account that happened to hash to the same shard. ref: https://3.basecamp.com/2914079/buckets/27/card_tables/cards/9782824728
This commit is contained in:
@@ -9,6 +9,6 @@ module Account::Searchable
|
||||
|
||||
private
|
||||
def clear_search_records
|
||||
Search::Record.for(id).destroy_all
|
||||
Search::Record.for(id).where(account_id: id).destroy_all
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user