From 8d351eac078642505057351e7113100550ed8bc7 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 23 Nov 2009 19:44:43 -0600 Subject: Extract Routing.controller_constraints --- actionpack/lib/action_dispatch/routing.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionpack/lib/action_dispatch/routing.rb') 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. -- cgit v1.2.3