From 55320ff69579f2dbe4ded1a88e7ff377d7a2eae9 Mon Sep 17 00:00:00 2001 From: Pavel Shutsin Date: Tue, 30 Jul 2019 13:04:10 +0300 Subject: Add inheritance flexibility to issuable collections --- app/controllers/concerns/issuable_collections.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/concerns/issuable_collections.rb b/app/controllers/concerns/issuable_collections.rb index 21b3949e361..3489ea78b77 100644 --- a/app/controllers/concerns/issuable_collections.rb +++ b/app/controllers/concerns/issuable_collections.rb @@ -194,10 +194,9 @@ module IssuableCollections end def collection_type - @collection_type ||= case finder_type.name - when 'IssuesFinder' + @collection_type ||= if finder_type <= IssuesFinder 'Issue' - when 'MergeRequestsFinder' + elsif finder_type <= MergeRequestsFinder 'MergeRequest' end end -- cgit v1.2.1