summaryrefslogtreecommitdiff
path: root/app/finders/tags_finder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/tags_finder.rb')
-rw-r--r--app/finders/tags_finder.rb28
1 files changed, 5 insertions, 23 deletions
diff --git a/app/finders/tags_finder.rb b/app/finders/tags_finder.rb
index 2ffd46245e9..fd58f478b45 100644
--- a/app/finders/tags_finder.rb
+++ b/app/finders/tags_finder.rb
@@ -1,31 +1,13 @@
# frozen_string_literal: true
-class TagsFinder
+class TagsFinder < GitRefsFinder
def initialize(repository, params)
- @repository = repository
- @params = params
+ super(repository, params)
end
def execute
- tags = @repository.tags_sorted_by(sort)
- filter_by_name(tags)
- end
-
- private
-
- def sort
- @params[:sort].presence
- end
-
- def search
- @params[:search].presence
- end
-
- def filter_by_name(tags)
- if search
- tags.select { |tag| tag.name.include?(search) }
- else
- tags
- end
+ tags = repository.tags_sorted_by(sort)
+ tags = by_search(tags)
+ tags
end
end