From 7b50d7f2496a84bec5aceb9e0fd1f1f9dcbdab88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 14 May 2014 14:26:46 -0300 Subject: [PATCH] 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. --- actionview/lib/action_view/view_paths.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actionview/lib/action_view/view_paths.rb b/actionview/lib/action_view/view_paths.rb index e341c11c73..80a41f2418 100644 --- a/actionview/lib/action_view/view_paths.rb +++ b/actionview/lib/action_view/view_paths.rb @@ -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