Commit f4b60319 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Remove duplicate IDs in query

parent 4d3b1d55
......@@ -50,7 +50,7 @@ class List < ApplicationRecord
list_ids = items.map { |i| i[:list_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)
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