diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2015-04-22 15:45:24 -0400 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2015-06-11 16:54:13 -0300 |
commit | b643d7a7c6584a07624d2169a6cb54b38d345958 (patch) | |
tree | 2207e98689f4aa20943cc29fd1cea09002f9a4e4 /actionpack | |
parent | e7b89f10813e16936f305b0cc5456c7e37e8ee9a (diff) | |
download | rails-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.rb | 12 |
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 ## |