debian-mirror-gitlab/app/models/global_label.rb
2015-11-26 14:37:03 +05:30

17 lines
312 B
Ruby

class GlobalLabel
attr_accessor :title, :labels
alias_attribute :name, :title
def self.build_collection(labels)
labels = labels.group_by(&:title)
labels.map do |title, label|
new(title, label)
end
end
def initialize(title, labels)
@title = title
@labels = labels
end
end