diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-08-19 17:42:34 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-08-19 17:42:34 +0200 |
commit | 7e0a2b3b3dac62541abf990ca633cb272c58d4cf (patch) | |
tree | fb4bd55d31b88118d77fdb299dc177d8c3451024 /db | |
parent | 0b3ebb6440420de714fe5066aba19ca77e8b1b8f (diff) | |
download | gitlab-ce-7e0a2b3b3dac62541abf990ca633cb272c58d4cf.tar.gz |
Test if the label is valid before creating link
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20140729152420_migrate_taggable_labels.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/20140729152420_migrate_taggable_labels.rb b/db/migrate/20140729152420_migrate_taggable_labels.rb index 0b844720ba1..06b60a1c92f 100644 --- a/db/migrate/20140729152420_migrate_taggable_labels.rb +++ b/db/migrate/20140729152420_migrate_taggable_labels.rb @@ -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' |