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

parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment