summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorMark Fletcher <mark@gitlab.com>2017-09-19 16:53:32 +1000
committerMark Fletcher <mark@gitlab.com>2017-09-20 08:27:16 +1000
commit5f331ab7008ae6d5931873fb674daf9bc8aa06be (patch)
tree5420045e315920d79c8995a8d5b5f48a05b72524 /app/finders
parentff594bb3a9e5fae72a286132b88e2f1ebd4549af (diff)
downloadgitlab-ce-5f331ab7008ae6d5931873fb674daf9bc8aa06be.tar.gz
Introduce ForkProjectsFinder class
* Will dry up the code to find projects between the ForksController and the API
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/fork_projects_finder.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/finders/fork_projects_finder.rb b/app/finders/fork_projects_finder.rb
new file mode 100644
index 00000000000..28d1b31868e
--- /dev/null
+++ b/app/finders/fork_projects_finder.rb
@@ -0,0 +1,6 @@
+class ForkProjectsFinder < ProjectsFinder
+ def initialize(project, params: {}, current_user: nil)
+ project_ids = project.forks.includes(:creator).select(:id)
+ super(params: params, current_user: current_user, project_ids_relation: project_ids)
+ end
+end