Skip to content
Browse files

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.
  • Loading branch information...
1 parent 08477a6 commit a76b0cf8e542f8b747f57abc88a642a0d4ec833c @carlosantoniodasilva carlosantoniodasilva committed May 30, 2012
Showing with 3 additions and 7 deletions.
  1. +3 −7 actionpack/lib/action_dispatch/routing/route_set.rb
View
10 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -252,15 +252,11 @@ def initialize(request_class = ActionDispatch::Request)
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 = []

0 comments on commit a76b0cf

Please sign in to comment.
Something went wrong with that request. Please try again.