Merge pull request #1407 from okriuchykhin/ok_SCI_2823

Fix search across reports, search all readable projects [SCI-2823]
This commit is contained in:
Alex Kriuchykhin 2018-12-03 11:39:25 +01:00 committed by GitHub
commit c6cc06a97e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,11 +43,8 @@ class Report < ApplicationRecord
new_query =
Report
.distinct
.joins('LEFT OUTER JOIN users ON users.id = reports.user_id ' \
'OR users.id = reports.last_modified_by_id')
.where('reports.project_id IN (?)', project_ids)
.where('reports.user_id = (?)', user.id)
.where_attributes_like([:name, :description], query, options)
.where_attributes_like(%i(name description), query, options)
# Show all results if needed
if page == Constants::SEARCH_NO_LIMIT