From c1bc70e229be479b99bc2100e7a26059a6c107eb Mon Sep 17 00:00:00 2001
From: Aaron Patterson <aaron.patterson@gmail.com>
Date: Sun, 25 May 2014 14:04:08 -0700
Subject: one fewer is_a check

---
 actionpack/lib/action_dispatch/routing/inspector.rb | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'actionpack')

diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb
index 4be49516bf..ff8b730249 100644
--- a/actionpack/lib/action_dispatch/routing/inspector.rb
+++ b/actionpack/lib/action_dispatch/routing/inspector.rb
@@ -14,11 +14,10 @@ module ActionDispatch
 
       def rack_app(app = self.app)
         @rack_app ||= begin
-          app = app.app
-          class_name = app.class.name.to_s
+          endpoint = app.app
 
-          if ActionDispatch::Routing::Redirect === app || class_name !~ /^ActionDispatch::Routing/
-            app
+          if ActionDispatch::Routing::Redirect === endpoint || !app.dispatcher?
+            endpoint
           end
         end
       end
-- 
cgit v1.2.3