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
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user