Define @_routes inside method, makes more sense and will be initialized when called anywhere.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Emilio Tagua 2010-09-27 16:17:32 -03:00 committed by Santiago Pastorino
parent 1ab2ab07b5
commit 8adb24016d
2 changed files with 1 additions and 2 deletions

@ -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)