diff options
author | Carl Lerche & Yehuda Katz <wycats@gmail.com> | 2009-04-13 16:56:04 -0700 |
---|---|---|
committer | Carl Lerche & Yehuda Katz <wycats@gmail.com> | 2009-04-13 16:56:04 -0700 |
commit | 647b83d50cba655422bcb83815f618b5a92bfc7d (patch) | |
tree | 72ea7eaf5344a19161c59812707b3055d98adfbe /actionpack/lib/action_controller | |
parent | 906aebceedb95d8caa6db6314bc90f605bdfaf2b (diff) | |
download | rails-647b83d50cba655422bcb83815f618b5a92bfc7d.tar.gz rails-647b83d50cba655422bcb83815f618b5a92bfc7d.tar.bz2 rails-647b83d50cba655422bcb83815f618b5a92bfc7d.zip |
Resurrecting 1.9 compatibility.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/base/layout.rb | 9 | ||||
-rw-r--r-- | actionpack/lib/action_controller/base/render.rb | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/base/layout.rb b/actionpack/lib/action_controller/base/layout.rb index 88a15aa6ca..4fcef6c5d9 100644 --- a/actionpack/lib/action_controller/base/layout.rb +++ b/actionpack/lib/action_controller/base/layout.rb @@ -174,7 +174,9 @@ module ActionController #:nodoc: end def default_layout(*args) - (@_memoized_default_layout ||= ::ActiveSupport::ConcurrentHash.new)[args] ||= memoized_default_layout(*args) + memoized_default_layout(*args) + @_memoized_default_layout ||= ::ActiveSupport::ConcurrentHash.new + @_memoized_default_layout[args] ||= memoized_default_layout(*args) end def memoized_find_layout(layout, formats) #:nodoc: @@ -184,7 +186,8 @@ module ActionController #:nodoc: end def find_layout(*args) - (@_memoized_find_layout ||= ::ActiveSupport::ConcurrentHash.new)[args] ||= memoized_find_layout(*args) + @_memoized_find_layout ||= ::ActiveSupport::ConcurrentHash.new + @_memoized_find_layout[args] ||= memoized_find_layout(*args) end def layout_list #:nodoc: @@ -222,7 +225,7 @@ module ActionController #:nodoc: self.class.find_layout(layout_name, formats) end - def _pick_layout(layout_name, implicit = false) + def _pick_layout(layout_name = nil, implicit = false) return unless layout_name || implicit layout_name = true if layout_name.nil? active_layout(layout_name) if action_has_layout? && layout_name diff --git a/actionpack/lib/action_controller/base/render.rb b/actionpack/lib/action_controller/base/render.rb index c4a3725079..0d24f18633 100644 --- a/actionpack/lib/action_controller/base/render.rb +++ b/actionpack/lib/action_controller/base/render.rb @@ -370,7 +370,7 @@ module ActionController end def render_for_parts(parts, layout, options = {}) - tmp = view_paths.find_by_parts(*parts) + tmp = view_paths.find_by_parts(*parts) layout = _pick_layout(*layout) unless tmp.exempt_from_layout? |