From 59d4563bcce7a31187b3484953041aa9ee82cd40 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Tue, 11 Jun 2024 22:43:05 +0200 Subject: [PATCH] Allow webp as image format for ActiveStorage It is only configured by default in unreleased Rails 7.2 --- lib/alchemy/engine.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/alchemy/engine.rb b/lib/alchemy/engine.rb index 7281ee62c2..b60c0ff17d 100644 --- a/lib/alchemy/engine.rb +++ b/lib/alchemy/engine.rb @@ -81,6 +81,11 @@ class Engine < Rails::Engine end end + initializer "alchemy.active_storage" do |app| + app.config.active_storage.web_image_content_types += %w[image/webp] + app.config.active_storage.content_types_allowed_inline += %w[image/webp] + end + config.after_initialize do if Alchemy.user_class ActiveSupport.on_load(:active_record) do