Fix results search [SCI-9596]

This commit is contained in:
Martin Artnik 2023-11-10 15:44:27 +01:00
parent 67ec9b63f3
commit cc5bbcde2f

View file

@ -43,9 +43,16 @@ class Result < ApplicationRecord
new_query =
Result
.distinct
.left_outer_joins(:result_texts)
.left_outer_joins(:result_texts, result_tables: :table)
.where(results: { my_module_id: module_ids })
.where_attributes_like(['results.name', 'result_texts.text'], query, options)
.where_attributes_like(
[
'results.name',
'result_texts.name',
'result_texts.text',
'tables.name'
], query, options
)
new_query = new_query.active unless include_archived