diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2013-05-20 20:46:04 +0200 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2013-05-20 20:46:04 +0200 |
commit | 378ea96905e5f95be1a413b7bdd6fbb000265129 (patch) | |
tree | abba0e22fcb401556b61d2f6ca487591852bfd03 /actionpack/lib/action_dispatch | |
parent | 97a607b32b69e79d074702cc44e70bf975a46f87 (diff) | |
download | rails-378ea96905e5f95be1a413b7bdd6fbb000265129.tar.gz rails-378ea96905e5f95be1a413b7bdd6fbb000265129.tar.bz2 rails-378ea96905e5f95be1a413b7bdd6fbb000265129.zip |
Add has_named_route? to the mapper API
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index c3fd0c18ec..3c58a2cfc3 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -515,6 +515,11 @@ module ActionDispatch end end + # Query if the following named route was already defined. + def has_named_route?(name) + @set.named_routes.routes[name.to_sym] + end + private def app_name(app) return unless app.respond_to?(:routes) |