|
|
|
@ -50,7 +50,8 @@ module Submissions
|
|
|
|
arel,
|
|
|
|
arel,
|
|
|
|
Submission.where(
|
|
|
|
Submission.where(
|
|
|
|
template_id: SearchEntry.where(record_type: 'Template')
|
|
|
|
template_id: SearchEntry.where(record_type: 'Template')
|
|
|
|
.where(account_id: current_user.account_id)
|
|
|
|
.where(account_id: [current_user.account_id,
|
|
|
|
|
|
|
|
current_user.account.linked_account_account&.account_id].compact)
|
|
|
|
.where(*SearchEntries.build_tsquery(keyword))
|
|
|
|
.where(*SearchEntries.build_tsquery(keyword))
|
|
|
|
.select(:record_id)
|
|
|
|
.select(:record_id)
|
|
|
|
).select(:id).arel
|
|
|
|
).select(:id).arel
|
|
|
|
|