diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-03-10 19:35:20 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-03-10 19:35:20 +0000 |
commit | 582edaa1ffd6d875e18c50e36e144544209fd158 (patch) | |
tree | ce4fb934973e1385ec64b78df6984e4a6267fc11 /actionpack/lib/action_dispatch/routing | |
parent | 2d3d9e3531d0d49a94ded10b993640053bd76c03 (diff) | |
parent | 51a269b2282ec09cf58614e738a2d0e40d2909d3 (diff) | |
download | rails-582edaa1ffd6d875e18c50e36e144544209fd158.tar.gz rails-582edaa1ffd6d875e18c50e36e144544209fd158.tar.bz2 rails-582edaa1ffd6d875e18c50e36e144544209fd158.zip |
Merge branch 'master' into nested_has_many_through
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route.rb b/actionpack/lib/action_dispatch/routing/route.rb index 08a8408f25..eae9d4ea6d 100644 --- a/actionpack/lib/action_dispatch/routing/route.rb +++ b/actionpack/lib/action_dispatch/routing/route.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/module/deprecation' + module ActionDispatch module Routing class Route #:nodoc: @@ -45,6 +47,7 @@ module ActionDispatch def to_a [@app, @conditions, @defaults, @name] end + deprecate :to_a def to_s @to_s ||= begin diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 61053d4464..b28f6c2297 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -333,7 +333,7 @@ module ActionDispatch def add_route(app, conditions = {}, requirements = {}, defaults = {}, name = nil, anchor = true) raise ArgumentError, "Invalid route name: '#{name}'" unless name.blank? || name.to_s.match(/^[_a-z]\w*$/i) route = Route.new(self, app, conditions, requirements, defaults, name, anchor) - @set.add_route(*route) + @set.add_route(route.app, route.conditions, route.defaults, route.name) named_routes[name] = route if name routes << route route |