lib/image_optim/railtie.rb in image_optim-0.19.1 vs lib/image_optim/railtie.rb in image_optim-0.20.0
- old
+ new
@@ -12,16 +12,18 @@
return if app.config.assets.image_optim == false
app.assets
end
- def register_preprocessor(app)
- options = if app.config.assets.image_optim == true
+ def options
+ if app.config.assets.image_optim == true
{}
else
app.config.assets.image_optim || {}
end
+ end
+ def register_preprocessor(app)
image_optim = ImageOptim.new(options)
processor = proc do |_context, data|
image_optim.optimize_image_data(data) || data
end