提交 2deef25e 编写于 作者: D Douglas Barbosa Alexandre

Use Label.attributes instead of Label.dup when creating label templates

上级 bdf365e6
......@@ -733,12 +733,7 @@ class Project < ActiveRecord::Base
def create_labels
Label.templates.each do |label|
label = label.dup
label.template = false
label.project_id = self.id
label.type = 'ProjectLabel'
label.save
self.labels.create!(label.attributes.symbolize_keys.except(:id, :template))
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册