Commit 9b4313cf authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '32395-remove-duplicate-ids-in-query' into 'master'

Remove duplicate IDs in query

Closes #32395

See merge request gitlab-org/gitlab!18190
parents a403cea8 f4b60319
...@@ -50,7 +50,7 @@ class List < ApplicationRecord ...@@ -50,7 +50,7 @@ class List < ApplicationRecord
list_ids = items.map { |i| i[:list_id] } list_ids = items.map { |i| i[:list_id] }
user_ids = items.map { |i| i[:user_id] } user_ids = items.map { |i| i[:user_id] }
ListUserPreference.where(list_id: list_ids, user_id: user_ids).find_each do |preference| ListUserPreference.where(list_id: list_ids.uniq, user_id: user_ids.uniq).find_each do |preference|
loader.call({ list_id: preference.list_id, user_id: preference.user_id }, preference) loader.call({ list_id: preference.list_id, user_id: preference.user_id }, preference)
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