aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-30 21:24:11 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-31 09:38:24 -0300
commita76b0cf8e542f8b747f57abc88a642a0d4ec833c (patch)
tree664d26782a8462da0eac3fe8ff78c9effbec452a
parent08477a651648ba4417ded128aa37b9ae0dcbc9ce (diff)
downloadrails-a76b0cf8e542f8b747f57abc88a642a0d4ec833c.tar.gz
rails-a76b0cf8e542f8b747f57abc88a642a0d4ec833c.tar.bz2
rails-a76b0cf8e542f8b747f57abc88a642a0d4ec833c.zip
Simplify logic to initialize valid conditions in RouteSet
Remove :to_sym call from public_instance_methods iteration, as such methods in Ruby 1.9 already return symbols. Initialize valid conditions with controller/action instead of setting them afterwards.
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 7872f4007e..64b1d58ae9 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -252,15 +252,11 @@ module ActionDispatch
self.draw_paths = []
self.request_class = request_class
- @valid_conditions = {}
-
+ @valid_conditions = { :controller => true, :action => true }
request_class.public_instance_methods.each { |m|
- @valid_conditions[m.to_sym] = true
+ @valid_conditions[m] = true
}
- @valid_conditions[:controller] = true
- @valid_conditions[:action] = true
-
- self.valid_conditions.delete(:id)
+ @valid_conditions.delete(:id)
@append = []
@prepend = []