diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-08-20 11:54:47 +0400 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-08-20 11:56:49 +0400 |
commit | 30ba7aea19203998eda68203ce0cdac38fa6b48b (patch) | |
tree | d2b78d358473c784c6fca1b5acfd3177b2943702 /db/migrate | |
parent | ed9e922dd0047435b8d349f0c949ba0a2d789247 (diff) |
Document characters being stripped from labels
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20140729152420_migrate_taggable_labels.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/db/migrate/20140729152420_migrate_taggable_labels.rb b/db/migrate/20140729152420_migrate_taggable_labels.rb index f747fd71536..f164015506d 100644 --- a/db/migrate/20140729152420_migrate_taggable_labels.rb +++ b/db/migrate/20140729152420_migrate_taggable_labels.rb @@ -15,7 +15,9 @@ class MigrateTaggableLabels < ActiveRecord::Migration def create_label_from_tagging(tagging) target = tagging.taggable - label_name = tagging.tag.name.tr('?&,', '') + label_name = tagging.tag.name + # '?', '&' and ',' are no longer allowed in label names so we remove them + label_name.tr!('?&,', '') label = target.project.labels.find_or_create_by(title: label_name, color: Label::DEFAULT_COLOR) if label.valid? && LabelLink.create(label: label, target: target) |