ruby-on-railsrails-activestorage

How can you turrn off or disable active storage preprocessing?


Since the back port of a change to active storage for the preprocessing of variants for pdf files, it has now started producing failing jobs. My application has no need for previews. Is there any way to disable or turn off this behaviour? Looking ate the source code it seems it is pretty well baked in and only monkey patching may get around it. I am not so keen on monkey patching core code as it may cause me issues later in upgrades.

Any help would be appreciated.


Solution

  • From ActiveStorage::Preview.

    In a Rails application, add or remove previewers by manipulating Rails.application.config.active_storage.previewers in an initializer:

    You can remove the two default PDF previewer classes.

    Rails.application.config.active_storage.previewers -= [
      ActiveStorage::Previewer::PopplerPDFPreviewer,
      ActiveStorage::Previewer::MuPDFPreviewer
    ]