diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-14 16:25:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-14 16:25:03 -0700 |
commit | 4bdd92d9fd731b69ba6e12e6e45dd5bbb3ffd6dd (patch) | |
tree | 59503a1480ebb2e8493ac6bef084ddbd7d88396b /actionpack/lib | |
parent | 6c48d9392fe964640fe5721fcd27bb170613cc27 (diff) | |
download | rails-4bdd92d9fd731b69ba6e12e6e45dd5bbb3ffd6dd.tar.gz rails-4bdd92d9fd731b69ba6e12e6e45dd5bbb3ffd6dd.tar.bz2 rails-4bdd92d9fd731b69ba6e12e6e45dd5bbb3ffd6dd.zip |
rm add_route2
refactor the tests with a backwards compatible method call so we can rm
add_route2 from the journey router
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/routes.rb | 8 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 |
2 files changed, 2 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/journey/routes.rb b/actionpack/lib/action_dispatch/journey/routes.rb index eba43c3c36..dacb0ccf48 100644 --- a/actionpack/lib/action_dispatch/journey/routes.rb +++ b/actionpack/lib/action_dispatch/journey/routes.rb @@ -62,13 +62,7 @@ module ActionDispatch end end - MyMapping = Struct.new(:application, :path, :conditions, :required_defaults, :defaults) - - def add_route(app, path, conditions, required_defaults, defaults, name = nil) - add_route2(name, MyMapping.new(app, path, conditions, required_defaults, defaults)) - end - - def add_route2(name, mapping) + def add_route(name, mapping) route = Route.new(name, mapping.application, mapping.path, diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 23dd865ed0..4f698c84ab 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -525,7 +525,7 @@ module ActionDispatch "http://guides.rubyonrails.org/routing.html#restricting-the-routes-created" end - route = @set.add_route2(name, mapping) + route = @set.add_route(name, mapping) named_routes[name] = route if name route end |