Skip update query if label have the same id on Labels::TransferService

This commit is contained in:
Douglas Barbosa Alexandre 2016-10-13 17:25:25 -03:00
parent 5912251e61
commit fc59d35720
1 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,8 @@ module Labels
labels_to_transfer.find_each do |label|
new_label_id = find_or_create_label!(label)
next if new_label_id == label.id
LabelLink.where(label_id: label.id).update_all(label_id: new_label_id)
end
end