diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-13 17:25:25 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 14:58:26 -0200 |
commit | fc59d357201a907e6079f6f0a7fc9a31f2957f88 (patch) | |
tree | 0e0b2606f8f679a763e9fdba3deead5501fc7ae6 /app/services | |
parent | 5912251e614421b4798ac235c7f408a1b45a2b4c (diff) | |
download | gitlab-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.rb | 2 |
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 |