Skip to content

Commit

Permalink
Allow webp as image format for ActiveStorage
Browse files Browse the repository at this point in the history
It is only configured by default in unreleased Rails 7.2
  • Loading branch information
tvdeyen committed Sep 18, 2024
1 parent bc2cc12 commit 59d4563
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/alchemy/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59d4563

Please sign in to comment.