Skip to content

Commit

Permalink
update middleware loading target for rails 5
Browse files Browse the repository at this point in the history
Logic from ericallam#53
  • Loading branch information
tlbrack authored May 22, 2018
1 parent eeb6ef4 commit e78df08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/font_assets/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class Railtie < Rails::Railtie
config.font_assets.origin ||= "*"
config.font_assets.options ||= { allow_ssl: true }

insert_target = if defined?(ActionDispatch::Static)
middleware_operations = app.middleware.instance_variable_get(:@operations)
insert_target = if defined?(ActionDispatch::Static) && middleware_operations.flatten.map(&:to_s).include?('ActionDispatch::Static')
ActionDispatch::Static
else
Rack::Runtime
Expand Down

0 comments on commit e78df08

Please sign in to comment.