1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Tidy up valid conditions in router a bit.

This commit is contained in:
José Valim 2010-06-28 16:57:14 +02:00
parent 02a1a4edc8
commit 6dfa8d8e95

View file

@ -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!