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

parent 5912251e
...@@ -19,6 +19,8 @@ module Labels ...@@ -19,6 +19,8 @@ module Labels
labels_to_transfer.find_each do |label| labels_to_transfer.find_each do |label|
new_label_id = find_or_create_label!(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) LabelLink.where(label_id: label.id).update_all(label_id: new_label_id)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment