mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Refactoring the code to make consitional return explicit
This commit is contained in:
parent
0af0ffde18
commit
7bcd66e449
1 changed files with 8 additions and 3 deletions
|
@ -16,12 +16,16 @@ module ActionView
|
|||
module ClassMethods
|
||||
def _prefixes # :nodoc:
|
||||
@_prefixes ||= begin
|
||||
deprecated_prefixes = handle_deprecated_parent_prefixes and return deprecated_prefixes
|
||||
deprecated_prefixes = handle_deprecated_parent_prefixes
|
||||
return deprecated_prefixes if deprecated_prefixes
|
||||
|
||||
return local_prefixes if superclass.abstract?
|
||||
if superclass.abstract?
|
||||
local_prefixes
|
||||
else
|
||||
local_prefixes + superclass._prefixes
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
@ -33,6 +37,7 @@ module ActionView
|
|||
|
||||
def handle_deprecated_parent_prefixes # TODO: remove in 4.3/5.0.
|
||||
return unless respond_to?(:parent_prefixes)
|
||||
|
||||
ActiveSupport::Deprecation.warn "Overriding ActionController::Base::parent_prefixes is deprecated, override .local_prefixes instead."
|
||||
local_prefixes + parent_prefixes
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue