Skip to content

Commit

Permalink
Fix should_use_cache check to avoid calling it on the wrong class. (#454
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dylanahsmith authored Apr 20, 2020
1 parent 088269e commit daaba73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/identity_cache/cached/prefetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def prefetch(klass, associations, records, load_strategy: LoadStrategy::Eager)
private

def fetch_association(load_strategy, klass, association, records, &block)
unless records.first.class.should_use_cache?
unless klass.should_use_cache?
ActiveRecord::Associations::Preloader.new.preload(records, association)
return yield
end
Expand Down

0 comments on commit daaba73

Please sign in to comment.