Update query simplification

Rails 5 didn't like the arel usage, see:
https://gitlab.com/gitlab-org/gitlab-ce/issues/49873#note_92040225

This change makes that right, but also makes the query nicer. I'm not
sure anymore why it didn't work before, however there were issues with
it that have been resolved.
This commit is contained in:
Zeger-Jan van de Weg 2018-08-02 14:09:49 +02:00
parent eed31ddcef
commit 6e03a0f75c
No known key found for this signature in database
GPG Key ID: 65F6A8D64A88ABAC
1 changed files with 1 additions and 2 deletions

View File

@ -13,10 +13,9 @@ module Projects
detection.updates.each do |update|
RepositoryLanguage
.arel_table.update_manager
.where(project_id: project.id)
.where(programming_language_id: update[:programming_language_id])
.set(share: update[:share])
.update_all(share: update[:share])
end
Gitlab::Database.bulk_insert(