diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-14 14:26:46 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-14 14:28:54 -0300 |
commit | 7b50d7f2496a84bec5aceb9e0fd1f1f9dcbdab88 (patch) | |
tree | d3f60f1267cfd8c47ac402953bc4a27665b1bdd9 /actionview | |
parent | 548cb1cf7b7a6590cab9cbe28f8677c30c9c6871 (diff) | |
download | rails-7b50d7f2496a84bec5aceb9e0fd1f1f9dcbdab88.tar.gz rails-7b50d7f2496a84bec5aceb9e0fd1f1f9dcbdab88.tar.bz2 rails-7b50d7f2496a84bec5aceb9e0fd1f1f9dcbdab88.zip |
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.
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/view_paths.rb | 8 |
1 files 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 |