mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
We need an explicit return
If we don't return early Ruby will memoize the value of the prefix of the parent class what will make the subsequent searchs to not work as expected. If the early return we are avoiding the memoization. But when using the deprecated path we need to memoize the value, so we are not using early return for the deprecated path.
This commit is contained in:
parent
548cb1cf7b
commit
7b50d7f249
1 changed files with 4 additions and 4 deletions
|
@ -17,11 +17,11 @@ module ActionView
|
||||||
def _prefixes # :nodoc:
|
def _prefixes # :nodoc:
|
||||||
@_prefixes ||= begin
|
@_prefixes ||= begin
|
||||||
deprecated_prefixes = handle_deprecated_parent_prefixes
|
deprecated_prefixes = handle_deprecated_parent_prefixes
|
||||||
return deprecated_prefixes if deprecated_prefixes
|
if deprecated_prefixes
|
||||||
|
deprecated_prefixes
|
||||||
if superclass.abstract?
|
|
||||||
local_prefixes
|
|
||||||
else
|
else
|
||||||
|
return local_prefixes if superclass.abstract?
|
||||||
|
|
||||||
local_prefixes + superclass._prefixes
|
local_prefixes + superclass._prefixes
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue