Commit d11918de authored by Stan Hu's avatar Stan Hu

Rename preloads variable in GraphQL lookahead

The `apply_lookahead` defines a method `preloads` but redefines this
method as a local variable. Rename the local variable to avoid
confusion.
parent e6407be9
...@@ -20,11 +20,11 @@ module LooksAhead ...@@ -20,11 +20,11 @@ module LooksAhead
includes = preloads.each.flat_map do |name, requirements| includes = preloads.each.flat_map do |name, requirements|
selection&.selects?(name) ? requirements : [] selection&.selects?(name) ? requirements : []
end end
preloads = (unconditional_includes + includes).uniq all_preloads = (unconditional_includes + includes).uniq
return query if preloads.empty? return query if all_preloads.empty?
query.preload(*preloads) # rubocop: disable CodeReuse/ActiveRecord query.preload(*all_preloads) # rubocop: disable CodeReuse/ActiveRecord
end end
private private
......
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