From bf3c7e7840b1c1d97ea4c4d4452bfdc2dda70e3e Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 30 Nov 2018 11:46:13 +0100 Subject: [PATCH] Fix search across reports, search all readable projects [SCI-2823] --- app/models/report.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/report.rb b/app/models/report.rb index f03ec2e80..84620045a 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -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