diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 9de8849a90283..e69112419371a 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -83,7 +83,9 @@ class NamedRouteCollection #:nodoc: attr_reader :routes, :helpers, :module def initialize - clear! + @routes = {} + @helpers = [] + @module = Module.new end def helper_names @@ -91,10 +93,8 @@ def helper_names end def clear! - @routes = {} - @helpers = [] - - @module ||= Module.new + @routes.clear + @helpers.clear end def add(name, route)