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 Nov 27, 2024
1 parent 6581373 commit 3a44cef
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 @@ -95,6 +95,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 3a44cef

Please sign in to comment.