diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-18 14:55:13 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-18 14:55:29 -0700 |
commit | 523d0f3700f5bb68cdd3d549eaad63d8a88c2aef (patch) | |
tree | a9ce703bc593defdda7b3d6bab45e3f3f9cc6f39 /actionpack/lib/abstract_controller | |
parent | d8c7efece60f23d09031c11928be5048ac6340de (diff) | |
download | rails-523d0f3700f5bb68cdd3d549eaad63d8a88c2aef.tar.gz rails-523d0f3700f5bb68cdd3d549eaad63d8a88c2aef.tar.bz2 rails-523d0f3700f5bb68cdd3d549eaad63d8a88c2aef.zip |
Remove caching's dependency on view_context. Also, make it so that the layout is always rendered the same way (so that layout dependencies on the action actually being rendered aren't masked on the first render)
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/layouts.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 24a3923447..39a389dcb9 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -185,6 +185,8 @@ module AbstractController # ==== Returns # Boolean:: True if the action has a layout, false otherwise. def action_has_layout? + return unless super + conditions = _layout_conditions if only = conditions[:only] @@ -297,6 +299,16 @@ module AbstractController end end + attr_writer :action_has_layout + + def initialize(*) + @action_has_layout = true + end + + def action_has_layout? + @action_has_layout + end + private # This will be overwritten by _write_layout_method @@ -353,9 +365,5 @@ module AbstractController def _include_layout?(options) (options.keys & [:text, :inline, :partial]).empty? || options.key?(:layout) end - - def action_has_layout? - true - end end end |