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:
Rafael Mendonça França 2014-05-14 14:26:46 -03:00
parent 548cb1cf7b
commit 7b50d7f249
1 changed files with 4 additions and 4 deletions

View File

@ -17,11 +17,11 @@ module ActionView
def _prefixes # :nodoc:
@_prefixes ||= begin
deprecated_prefixes = handle_deprecated_parent_prefixes
return deprecated_prefixes if deprecated_prefixes
if superclass.abstract?
local_prefixes
if deprecated_prefixes
deprecated_prefixes
else
return local_prefixes if superclass.abstract?
local_prefixes + superclass._prefixes
end
end