mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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:
parent
1ab2ab07b5
commit
8adb24016d
2 changed files with 1 additions and 2 deletions
|
@ -318,7 +318,7 @@ module ActionDispatch
|
||||||
singleton_class.send(:define_method, :_routes) { routes }
|
singleton_class.send(:define_method, :_routes) { routes }
|
||||||
end
|
end
|
||||||
|
|
||||||
define_method(:_routes) { @_routes || routes }
|
define_method(:_routes) { @_routes ||= nil; @_routes || routes }
|
||||||
end
|
end
|
||||||
|
|
||||||
helpers
|
helpers
|
||||||
|
|
|
@ -128,7 +128,6 @@ module ActionDispatch
|
||||||
when String
|
when String
|
||||||
options
|
options
|
||||||
when nil, Hash
|
when nil, Hash
|
||||||
@_routes ||= nil
|
|
||||||
_routes.url_for((options || {}).reverse_merge!(url_options).symbolize_keys)
|
_routes.url_for((options || {}).reverse_merge!(url_options).symbolize_keys)
|
||||||
else
|
else
|
||||||
polymorphic_url(options)
|
polymorphic_url(options)
|
||||||
|
|
Loading…
Reference in a new issue