summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-13 17:25:25 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:26 -0200
commitfc59d357201a907e6079f6f0a7fc9a31f2957f88 (patch)
tree0e0b2606f8f679a763e9fdba3deead5501fc7ae6 /app/services
parent5912251e614421b4798ac235c7f408a1b45a2b4c (diff)
downloadgitlab-ce-fc59d357201a907e6079f6f0a7fc9a31f2957f88.tar.gz
Skip update query if label have the same id on Labels::TransferService
Diffstat (limited to 'app/services')
-rw-r--r--app/services/labels/transfer_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/labels/transfer_service.rb b/app/services/labels/transfer_service.rb
index 81897c62c0f..04312c114ef 100644
--- a/app/services/labels/transfer_service.rb
+++ b/app/services/labels/transfer_service.rb
@@ -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