Commit 96e2fdad authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents e2b3ad5b 55ce545d
......@@ -129,6 +129,7 @@ class Project < ApplicationRecord
after_create :check_repository_absence!
acts_as_ordered_taggable
alias_method :topics, :tag_list
attr_accessor :old_path_with_namespace
attr_accessor :template_name
......
......@@ -390,16 +390,16 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
end
def topics_to_show
project.tag_list.take(MAX_TOPICS_TO_SHOW) # rubocop: disable CodeReuse/ActiveRecord
project.topics.take(MAX_TOPICS_TO_SHOW) # rubocop: disable CodeReuse/ActiveRecord
end
def topics_not_shown
project.tag_list - topics_to_show
project.topics - topics_to_show
end
def count_of_extra_topics_not_shown
if project.tag_list.count > MAX_TOPICS_TO_SHOW
project.tag_list.count - MAX_TOPICS_TO_SHOW
if project.topics.count > MAX_TOPICS_TO_SHOW
project.topics.count - MAX_TOPICS_TO_SHOW
else
0
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment