Test if the label is valid before creating link
This commit is contained in:
parent
0b3ebb6440
commit
7e0a2b3b3d
|
@ -18,7 +18,7 @@ class MigrateTaggableLabels < ActiveRecord::Migration
|
|||
label_name = tagging.tag.name
|
||||
label = target.project.labels.find_or_create_by(title: label_name)
|
||||
|
||||
if LabelLink.create(label: label, target: target)
|
||||
if label.valid? && LabelLink.create(label: label, target: target)
|
||||
print '.'
|
||||
else
|
||||
print 'F'
|
||||
|
|
Loading…
Reference in New Issue