aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-11-23 19:44:43 -0600
committerJoshua Peek <josh@joshpeek.com>2009-11-23 19:44:43 -0600
commit8d351eac078642505057351e7113100550ed8bc7 (patch)
treef069fc2edb293c3f2c2e16882fb45d0c0bab8957 /actionpack/lib/action_dispatch/routing.rb
parent53d7acdf4f3d61865fb4c4baa6f23601a93e3630 (diff)
downloadrails-8d351eac078642505057351e7113100550ed8bc7.tar.gz
rails-8d351eac078642505057351e7113100550ed8bc7.tar.bz2
rails-8d351eac078642505057351e7113100550ed8bc7.zip
Extract Routing.controller_constraints
Diffstat (limited to 'actionpack/lib/action_dispatch/routing.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing.rb b/actionpack/lib/action_dispatch/routing.rb
index 751dbb88d3..e0857fb2b1 100644
--- a/actionpack/lib/action_dispatch/routing.rb
+++ b/actionpack/lib/action_dispatch/routing.rb
@@ -276,6 +276,10 @@ module ActionDispatch
end
class << self
+ def controller_constraints
+ Regexp.union(*possible_controllers.collect { |n| Regexp.escape(n) })
+ end
+
# Expects an array of controller names as the first argument.
# Executes the passed block with only the named controllers named available.
# This method is used in internal Rails testing.