diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-02 15:28:27 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-09-02 15:28:27 +0300 |
commit | 20c2e90222ac0b12a4cc3fb9b9455232f6e250ae (patch) | |
tree | aad232b129a6822f383076777a82da5abb1c3c5f /app/finders | |
parent | 9ccef9a7b3c8bd007c897467c0fb944831db3fab (diff) | |
download | gitlab-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.rb | 2 | ||||
-rw-r--r-- | app/finders/merge_requests_finder.rb | 2 |
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 |