summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-08-19 17:42:34 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-08-19 17:42:34 +0200
commit7e0a2b3b3dac62541abf990ca633cb272c58d4cf (patch)
treefb4bd55d31b88118d77fdb299dc177d8c3451024 /db
parent0b3ebb6440420de714fe5066aba19ca77e8b1b8f (diff)
downloadgitlab-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.rb2
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'