Fix calculating tsvector on hidden records

We introduced this bug in commit 55d339572, since we didn't take hidden
records into consideration.

I've tried to use `update_column` to simplify the code, but got a syntax
error `unnamed portal parameter` and didn't find how to fix it.
This commit is contained in:
Javi Martín
2022-08-09 13:33:45 +02:00
parent f6fefde91d
commit e66b9687a2
2 changed files with 28 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ module SearchCache
end
def calculate_tsvector
self.class.where(id: id).update_all("tsv = (#{searchable_values_sql})")
self.class.with_hidden.where(id: id).update_all("tsv = (#{searchable_values_sql})")
end
private