diff options
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issues_finder.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb index d0a094ea4a6..a34cdf29c80 100644 --- a/app/finders/issues_finder.rb +++ b/app/finders/issues_finder.rb @@ -73,17 +73,11 @@ class IssuesFinder < IssuableFinder by_confidential(issues) end - # rubocop: disable CodeReuse/ActiveRecord def by_confidential(items) - if params[:confidential] == 'yes' - items.where('issues.confidential = TRUE') - elsif params[:confidential] == 'no' - items.where.not('issues.confidential = TRUE') - else - items - end + return items unless params[:confidential].present? + + params[:confidential] == 'yes' ? items.confidential_only : items.public_only end - # rubocop: enable CodeReuse/ActiveRecord def by_due_date(items) if due_date? |