aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-14 13:45:20 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-14 13:45:20 -0300
commit7bcd66e44942013729e9f6a6f6c771b1d8c7095d (patch)
tree4c40a70f40d3c15fcd5275b3d159a1a4dc6d57de /actionview/lib/action_view
parent0af0ffde1896f1796712493984a6ebc30a532a7f (diff)
downloadrails-7bcd66e44942013729e9f6a6f6c771b1d8c7095d.tar.gz
rails-7bcd66e44942013729e9f6a6f6c771b1d8c7095d.tar.bz2
rails-7bcd66e44942013729e9f6a6f6c771b1d8c7095d.zip
Refactoring the code to make consitional return explicit
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/view_paths.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/actionview/lib/action_view/view_paths.rb b/actionview/lib/action_view/view_paths.rb
index 1c1d90dfd8..e341c11c73 100644
--- a/actionview/lib/action_view/view_paths.rb
+++ b/actionview/lib/action_view/view_paths.rb
@@ -16,10 +16,14 @@ module ActionView
module ClassMethods
def _prefixes # :nodoc:
@_prefixes ||= begin
- deprecated_prefixes = handle_deprecated_parent_prefixes and return deprecated_prefixes
-
- return local_prefixes if superclass.abstract?
- local_prefixes + superclass._prefixes
+ deprecated_prefixes = handle_deprecated_parent_prefixes
+ return deprecated_prefixes if deprecated_prefixes
+
+ if superclass.abstract?
+ local_prefixes
+ else
+ local_prefixes + superclass._prefixes
+ end
end
end
@@ -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