diff options
-rw-r--r-- | railties/lib/initializer.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index f6b8899d58..dd4d483233 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -542,7 +542,9 @@ Run `rake gems:install` to install the missing gems. end def initialize_metal - configuration.middleware.insert_before(:"ActionController::RewindableInput", Rails::Rack::Metal) + configuration.middleware.insert_before( + :"ActionController::RewindableInput", + Rails::Rack::Metal, :if => Rails::Rack::Metal.metals.any?) end # Initializes framework-specific settings for each of the loaded frameworks |