lib/active_storage/engine.rb in activestorage-7.0.1 vs lib/active_storage/engine.rb in activestorage-7.0.2

- old
+ new

@@ -28,10 +28,11 @@ config.active_storage = ActiveSupport::OrderedOptions.new config.active_storage.previewers = [ ActiveStorage::Previewer::PopplerPDFPreviewer, ActiveStorage::Previewer::MuPDFPreviewer, ActiveStorage::Previewer::VideoPreviewer ] config.active_storage.analyzers = [ ActiveStorage::Analyzer::ImageAnalyzer::Vips, ActiveStorage::Analyzer::ImageAnalyzer::ImageMagick, ActiveStorage::Analyzer::VideoAnalyzer, ActiveStorage::Analyzer::AudioAnalyzer ] config.active_storage.paths = ActiveSupport::OrderedOptions.new config.active_storage.queues = ActiveSupport::InheritableOptions.new + config.active_storage.precompile_assets = true config.active_storage.variable_content_types = %w( image/png image/gif image/jpg @@ -165,11 +166,13 @@ end end end initializer "active_storage.asset" do - if Rails.application.config.respond_to?(:assets) - Rails.application.config.assets.precompile += %w( activestorage activestorage.esm ) + config.after_initialize do |app| + if app.config.respond_to?(:assets) && app.config.active_storage.precompile_assets + app.config.assets.precompile += %w( activestorage activestorage.esm ) + end end end initializer "active_storage.fixture_set" do ActiveSupport.on_load(:active_record_fixture_set) do