Commit 63cde167 authored by Stan Hu's avatar Stan Hu

Move label hash transformation to initialize

This should be equivalent in performance since `CsvBuilder` and the like
iterate through all issues.
parent 4abd67ff
......@@ -8,7 +8,7 @@ module Issues
def initialize(issuables_relation, project)
super
@labels = @issuables.labels_hash
@labels = @issuables.labels_hash.transform_values { |labels| labels.sort.join(',').presence }
end
def email(user)
......@@ -47,7 +47,7 @@ module Issues
end
def issue_labels(issue)
@labels[issue.id].sort.join(',').presence
@labels[issue.id]
end
# rubocop: disable CodeReuse/ActiveRecord
......
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