diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-11 14:13:26 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 14:58:26 -0200 |
commit | 2deef25eb0c87db2fddf8b25c95891650d9c43a7 (patch) | |
tree | 74151eff9a7fa355d53bcfb09a466c8fd209dfe2 | |
parent | bdf365e64f35e76ba6d9a372111ce502db11827e (diff) | |
download | gitlab-ce-2deef25eb0c87db2fddf8b25c95891650d9c43a7.tar.gz |
Use Label.attributes instead of Label.dup when creating label templates
-rw-r--r-- | app/models/project.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index a04817987b4..7ab624eafdf 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 |