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 2eeecb6 commit 77a78ef
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 77a78ef

Please sign in to comment.