diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-29 09:06:34 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-29 09:06:34 -0800 |
commit | c0904e47f2982c2cd323c44060e99cfbe8e9869a (patch) | |
tree | 00e8f85914b75ee3a81793cd384b192491b6b463 /actionpack/lib/action_dispatch/routing | |
parent | 25b10f4c1c7db7dea631d6877fdd6eae5947fe21 (diff) | |
download | rails-c0904e47f2982c2cd323c44060e99cfbe8e9869a.tar.gz rails-c0904e47f2982c2cd323c44060e99cfbe8e9869a.tar.bz2 rails-c0904e47f2982c2cd323c44060e99cfbe8e9869a.zip |
decouple initialize from clear!. Initialize ivars in initialize, clear
ivars in clear!
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 9de8849a90..e691124193 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -83,7 +83,9 @@ module ActionDispatch attr_reader :routes, :helpers, :module def initialize - clear! + @routes = {} + @helpers = [] + @module = Module.new end def helper_names @@ -91,10 +93,8 @@ module ActionDispatch end def clear! - @routes = {} - @helpers = [] - - @module ||= Module.new + @routes.clear + @helpers.clear end def add(name, route) |