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

parent bdf365e6
...@@ -733,12 +733,7 @@ class Project < ActiveRecord::Base ...@@ -733,12 +733,7 @@ class Project < ActiveRecord::Base
def create_labels def create_labels
Label.templates.each do |label| Label.templates.each do |label|
label = label.dup self.labels.create!(label.attributes.symbolize_keys.except(:id, :template))
label.template = false
label.project_id = self.id
label.type = 'ProjectLabel'
label.save
end end
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