Permalink
Browse files

Define @_routes inside method, makes more sense and will be initializ…

…ed when called anywhere.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
1 parent 1ab2ab0 commit 8adb24016d76a2257b79f4566de66e1b88e56c71 @miloops miloops committed with spastorino Sep 27, 2010
@@ -318,7 +318,7 @@ class << self
singleton_class.send(:define_method, :_routes) { routes }
end
- define_method(:_routes) { @_routes || routes }
+ define_method(:_routes) { @_routes ||= nil; @_routes || routes }
end
helpers
@@ -128,7 +128,6 @@ def url_for(options = nil)
when String
options
when nil, Hash
- @_routes ||= nil
_routes.url_for((options || {}).reverse_merge!(url_options).symbolize_keys)
else
polymorphic_url(options)

0 comments on commit 8adb240

Please sign in to comment.