aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2015-04-22 15:45:24 -0400
committerSantiago Pastorino <santiago@wyeworks.com>2015-06-11 16:54:13 -0300
commitb643d7a7c6584a07624d2169a6cb54b38d345958 (patch)
tree2207e98689f4aa20943cc29fd1cea09002f9a4e4 /actionpack
parente7b89f10813e16936f305b0cc5456c7e37e8ee9a (diff)
downloadrails-b643d7a7c6584a07624d2169a6cb54b38d345958.tar.gz
rails-b643d7a7c6584a07624d2169a6cb54b38d345958.tar.bz2
rails-b643d7a7c6584a07624d2169a6cb54b38d345958.zip
Refactor internal? to query internal_controller? and internal_asset? methods
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/inspector.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb
index 48c10a7d4c..aa507f59c7 100644
--- a/actionpack/lib/action_dispatch/routing/inspector.rb
+++ b/actionpack/lib/action_dispatch/routing/inspector.rb
@@ -45,12 +45,22 @@ module ActionDispatch
end
def internal?
- controller.to_s =~ %r{\Arails/(info|mailers|welcome)}
+ internal_controller? || internal_asset?
end
def engine?
rack_app.respond_to?(:routes)
end
+
+ private
+ def internal_controller?
+ controller.to_s =~ %r{\arails/(info|mailers|welcome)}
+ end
+
+ def internal_asset?
+ Rails.application.config.respond_to?(:assets) &&
+ path =~ %r{\a#{Rails.application.config.assets.prefix}\z}
+ end
end
##