Add search scope from searchable concern [SCI-5551]

This commit is contained in:
aignatov-bio 2021-05-17 09:55:59 +02:00
parent e953666762
commit e058adab08

View file

@ -104,8 +104,10 @@ class ReportDatatable < CustomDatatable
end
def filter_records(records)
records.where('project_name ILIKE :q OR reports.name ILIKE :q OR reports.description ILIKE :q',
{ q: "%#{dt_params.dig(:search, :value)}%" })
records.where_attributes_like(
['project_name', 'reports.name', 'reports.description'],
dt_params.dig(:search, :value)
)
end
# ==== Insert 'presenter'-like methods below if necessary