diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-28 16:57:14 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-28 16:57:14 +0200 |
commit | 6dfa8d8e95ebd4b6bc177954173adf5cdd9b28b1 (patch) | |
tree | ecc9ee1e21af8b3d0fc1ea894970cbb1fac451ec /actionpack | |
parent | 02a1a4edc8cce6a9f86ba56b4143e69cf25c2f7e (diff) | |
download | rails-6dfa8d8e95ebd4b6bc177954173adf5cdd9b28b1.tar.gz rails-6dfa8d8e95ebd4b6bc177954173adf5cdd9b28b1.tar.bz2 rails-6dfa8d8e95ebd4b6bc177954173adf5cdd9b28b1.zip |
Tidy up valid conditions in router a bit.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 4b6d4fef97..5ecad6bc04 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -201,9 +201,11 @@ module ActionDispatch self.resources_path_names = self.class.default_resources_path_names.dup self.controller_namespaces = Set.new self.default_url_options = {} + self.request_class = request_class - self.valid_conditions = request_class.public_instance_methods.select{ |m| m != "id" }.map{ |m| m.to_sym } - self.valid_conditions += [:controller, :action] + self.valid_conditions = request_class.public_instance_methods.map { |m| m.to_sym } + self.valid_conditions.delete(:id) + self.valid_conditions.push(:controller, :action) @disable_clear_and_finalize = false clear! |