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 Dec 3, 2024
1 parent d859b19 commit b61ce70
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 b61ce70

Please sign in to comment.