diff options
-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 | ||||
-rw-r--r-- | lib/api/issues.rb | 6 |
4 files changed, 9 insertions, 7 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 diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 299fd7e2399..043ce04d321 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -6,9 +6,9 @@ module API helpers do def filter_issues_state(issues, state = nil) case state - when 'opened' then issues.opened - when 'closed' then issues.closed - else issues + when 'opened' then issues.opened + when 'closed' then issues.closed + else issues end end end |