diff --git a/app/models/repository.rb b/app/models/repository.rb index 9ae09e722..4d2ccefaa 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -281,9 +281,8 @@ class Repository < ActiveRecord::Base new_user_id = h[committer] if new_user_id && (new_user_id.to_i != user_id.to_i) new_user_id = (new_user_id.to_i > 0 ? new_user_id.to_i : nil) - Changeset.update_all( - "user_id = #{ new_user_id.nil? ? 'NULL' : new_user_id }", - ["repository_id = ? AND committer = ?", id, committer]) + Changeset.where(["repository_id = ? AND committer = ?", id, committer]). + update_all("user_id = #{new_user_id.nil? ? 'NULL' : new_user_id}") end end @committers = nil