Avoid N+1 queries during file integrity check rake tasks
The following discussion from !19501 (merged) should be addressed:
-
@mbergeron started a discussion: @mkozono I've forgot to tell you that you should
preload(:model)
when using#build_uploader
to avoid N+1 queries. Asmodel
is a polymorphic association (on STI models even) you might have to go frommodel
's type to type.