summaryrefslogtreecommitdiff
path: root/app/services/search
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-01 18:04:37 +0100
committerRobert Speicher <rspeicher@gmail.com>2016-03-11 15:25:22 -0500
commitec349dc1b6659d8f691cb1c1fb287aa05c9d9246 (patch)
tree26356f1a05aaa978cef7d1c2c6e81e0def2d97ba /app/services/search
parent42fde69d39234368f8252febc9bf6ca3eca6f275 (diff)
downloadgitlab-ce-ec349dc1b6659d8f691cb1c1fb287aa05c9d9246.tar.gz
Refactor Gitlab::ProjectSearchResults
Previously this class would be given a project ID which was then used to retrieve the corresponding Project object. However, in all cases the Project object was already known as it was used to grab the ID to pass to ProjectSearchResults. By just passing a Project instead we remove the need for an extra query as well as the need for some other complexity in this class.
Diffstat (limited to 'app/services/search')
-rw-r--r--app/services/search/project_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/search/project_service.rb b/app/services/search/project_service.rb
index f630c0a3790..c08881dce4b 100644
--- a/app/services/search/project_service.rb
+++ b/app/services/search/project_service.rb
@@ -7,7 +7,7 @@ module Search
end
def execute
- Gitlab::ProjectSearchResults.new(project.id,
+ Gitlab::ProjectSearchResults.new(project,
params[:search],
params[:repository_ref])
end