Skip to content

Commit

Permalink
Fix Preloader to not generate a query for already loaded association …
Browse files Browse the repository at this point in the history
…with query_constraints (#1150)
  • Loading branch information
aidanharan authored Jan 18, 2024
1 parent 48c89b1 commit c75651b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module LoaderQuery
def load_records_for_keys(keys, &block)
return super unless scope.connection.sqlserver?

return [] if keys.empty?

if association_key_name.is_a?(Array)
query_constraints = Hash.new { |hsh, key| hsh[key] = Set.new }

Expand Down

0 comments on commit c75651b

Please sign in to comment.