File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# This is set in config/application.rb but it seems like the settings aren't loaded at that point so doing it again here
22Rails . application . config . active_storage . service = ( Settings &.active_storage &.service . presence || "local" ) . to_sym
3+
4+ Rails . application . config . to_prepare do
5+ # Override ActiveStorage behavior to allow inline disposition for all file types
6+ # See https://github.com/avalonmediasystem/avalon/issues/6399
7+ # and https://github.com/rails/rails/blob/v8.0.4/activestorage/app/models/active_storage/blob/servable.rb
8+ ActiveStorage ::Blob ::Servable . module_eval do
9+ def forcibly_serve_as_binary?
10+ #ActiveStorage.content_types_to_serve_as_binary.include?(content_type)
11+ false
12+ end
13+
14+ def allowed_inline?
15+ #ActiveStorage.content_types_allowed_inline.include?(content_type)
16+ true
17+ end
18+ end
19+ end
You can’t perform that action at this time.
0 commit comments