diff options
Diffstat (limited to 'lib/gitlab/search_results.rb')
-rw-r--r-- | lib/gitlab/search_results.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/search_results.rb b/lib/gitlab/search_results.rb index c9c65f76f4b..a1a6929103b 100644 --- a/lib/gitlab/search_results.rb +++ b/lib/gitlab/search_results.rb @@ -56,10 +56,10 @@ module Gitlab def issues issues = IssuesFinder.new(current_user).execute.where(project_id: project_ids_relation) - if query =~ /#(\d+)\z/ - issues = issues.where(iid: $1) + issues = if query =~ /#(\d+)\z/ + issues.where(iid: $1) else - issues = issues.full_search(query) + issues.full_search(query) end issues.order('updated_at DESC') @@ -73,10 +73,10 @@ module Gitlab def merge_requests merge_requests = MergeRequestsFinder.new(current_user).execute.in_projects(project_ids_relation) - if query =~ /[#!](\d+)\z/ - merge_requests = merge_requests.where(iid: $1) + merge_requests = if query =~ /[#!](\d+)\z/ + merge_requests.where(iid: $1) else - merge_requests = merge_requests.full_search(query) + merge_requests.full_search(query) end merge_requests.order('updated_at DESC') end |