Skip to content

Commit 7bcd66e

Browse files
committed
Refactoring the code to make consitional return explicit
1 parent 0af0ffd commit 7bcd66e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

actionview/lib/action_view/view_paths.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ module ViewPaths
1616
module ClassMethods
1717
def _prefixes # :nodoc:
1818
@_prefixes ||= begin
19-
deprecated_prefixes = handle_deprecated_parent_prefixes and return deprecated_prefixes
20-
21-
return local_prefixes if superclass.abstract?
22-
local_prefixes + superclass._prefixes
19+
deprecated_prefixes = handle_deprecated_parent_prefixes
20+
return deprecated_prefixes if deprecated_prefixes
21+
22+
if superclass.abstract?
23+
local_prefixes
24+
else
25+
local_prefixes + superclass._prefixes
26+
end
2327
end
2428
end
2529

@@ -33,6 +37,7 @@ def local_prefixes
3337

3438
def handle_deprecated_parent_prefixes # TODO: remove in 4.3/5.0.
3539
return unless respond_to?(:parent_prefixes)
40+
3641
ActiveSupport::Deprecation.warn "Overriding ActionController::Base::parent_prefixes is deprecated, override .local_prefixes instead."
3742
local_prefixes + parent_prefixes
3843
end

0 commit comments

Comments
 (0)