Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

stop being clever and just call methods on the Route object

  • Loading branch information...
commit 0c777bace2aed1833e068358461de62bbd59cd0c 1 parent f975626
@tenderlove tenderlove authored
View
3  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 @@ def segment_keys
def to_a
[@app, @conditions, @defaults, @name]
end
+ deprecate :to_a
def to_s
@to_s ||= begin
View
2  actionpack/lib/action_dispatch/routing/route_set.rb
@@ -333,7 +333,7 @@ def empty?
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

1 comment on commit 0c777ba

@Empact

<3 That one's for you, Aaron

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