summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-02 15:28:27 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-02 15:28:27 +0300
commit20c2e90222ac0b12a4cc3fb9b9455232f6e250ae (patch)
treeaad232b129a6822f383076777a82da5abb1c3c5f /app/finders
parent9ccef9a7b3c8bd007c897467c0fb944831db3fab (diff)
downloadgitlab-ce-20c2e90222ac0b12a4cc3fb9b9455232f6e250ae.tar.gz
Refactor finders. Prevent circular dependency error
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issuable_finder.rb (renamed from app/finders/base_finder.rb)6
-rw-r--r--app/finders/issues_finder.rb2
-rw-r--r--app/finders/merge_requests_finder.rb2
3 files changed, 6 insertions, 4 deletions
diff --git a/app/finders/base_finder.rb b/app/finders/issuable_finder.rb
index ec5f5919d7e..56c4f22120d 100644
--- a/app/finders/base_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -1,4 +1,4 @@
-# BaseFinder
+# IssuableFinder
#
# Used to filter Issues and MergeRequests collections by set of params
#
@@ -16,7 +16,9 @@
# label_name: string
# sort: string
#
-class BaseFinder
+require_relative 'projects_finder'
+
+class IssuableFinder
attr_accessor :current_user, :params
def execute(current_user, params)
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index 8e0c606249e..20a2b0ce8f0 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -15,7 +15,7 @@
# label_name: string
# sort: string
#
-class IssuesFinder < BaseFinder
+class IssuesFinder < IssuableFinder
def klass
Issue
end
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb
index 3727149c8fb..b258216d0d4 100644
--- a/app/finders/merge_requests_finder.rb
+++ b/app/finders/merge_requests_finder.rb
@@ -15,7 +15,7 @@
# label_name: string
# sort: string
#
-class MergeRequestsFinder < BaseFinder
+class MergeRequestsFinder < IssuableFinder
def klass
MergeRequest
end