This appears to be causing some memory bloat, likely because of the #select loading everything into memory.
Proposed actions:
Add the lazy_columns gem, or any gem that lazily loads ActiveRecord columns. In the Image model, exclude the binary data column so that it is only accessed just-in-time, not when the record is loaded.
Handle the condition in the #select block within the ActiveRecord query itself.
In the ImagesController,
This appears to be causing some memory bloat, likely because of the
#select
loading everything into memory.Proposed actions:
lazy_columns
gem, or any gem that lazily loads ActiveRecord columns. In the Image model, exclude the binary data column so that it is only accessed just-in-time, not when the record is loaded.#select
block within the ActiveRecord query itself.