From 90be80361f26d717f9842170315dd8659f35429d Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 10 Nov 2009 14:13:21 -0800 Subject: Eliminate warning with layout is unset --- actionpack/lib/abstract_controller/layouts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 1616f8030a..60bd486763 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -100,7 +100,7 @@ module AbstractController # name, return that string. Otherwise, use the superclass' # layout (which might also be implied) def _write_layout_method - case @_layout + case @_layout ||= nil when String self.class_eval %{def _layout(details) #{@_layout.inspect} end} when Symbol -- cgit v1.2.3 From be664392c030a2a0241616be764725f0e66d872b Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 10 Nov 2009 14:13:54 -0800 Subject: Eliminate warning by initializing nil formats --- actionpack/lib/abstract_controller/rendering_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/rendering_controller.rb b/actionpack/lib/abstract_controller/rendering_controller.rb index 0aae2b18e9..7054b9cf26 100644 --- a/actionpack/lib/abstract_controller/rendering_controller.rb +++ b/actionpack/lib/abstract_controller/rendering_controller.rb @@ -12,6 +12,12 @@ module AbstractController self._view_paths ||= ActionView::PathSet.new end + # Initialize controller with nil formats. + def initialize(*) #:nodoc: + @_formats = nil + super + end + # An instance of a view class. The default view class is ActionView::Base # # The view class must have the following methods: -- cgit v1.2.3 From 6480850d3787a2e56bf7ef01e2b6d823f488972e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 10 Nov 2009 15:43:37 -0800 Subject: Revert "Eliminate warning with layout is unset" This reverts commit 90be80361f26d717f9842170315dd8659f35429d. --- actionpack/lib/abstract_controller/layouts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 60bd486763..1616f8030a 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -100,7 +100,7 @@ module AbstractController # name, return that string. Otherwise, use the superclass' # layout (which might also be implied) def _write_layout_method - case @_layout ||= nil + case @_layout when String self.class_eval %{def _layout(details) #{@_layout.inspect} end} when Symbol -- cgit v1.2.3 From 1fcf32f8fef8fb5a63a66edacf556a107d12c049 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 10 Nov 2009 14:13:21 -0800 Subject: Eliminate warning with layout is unset --- actionpack/lib/abstract_controller/layouts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 1616f8030a..c71cef42b2 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -100,7 +100,7 @@ module AbstractController # name, return that string. Otherwise, use the superclass' # layout (which might also be implied) def _write_layout_method - case @_layout + case defined?(@_layout) ? @_layout : nil when String self.class_eval %{def _layout(details) #{@_layout.inspect} end} when Symbol -- cgit v1.2.3 From d8fd0499bfd6edc676ff3fbffc327656f6d5c320 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 10 Nov 2009 16:09:52 -0800 Subject: Revert "Eliminate warning with layout is unset" This reverts commit 1fcf32f8fef8fb5a63a66edacf556a107d12c049. --- actionpack/lib/abstract_controller/layouts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index c71cef42b2..1616f8030a 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -100,7 +100,7 @@ module AbstractController # name, return that string. Otherwise, use the superclass' # layout (which might also be implied) def _write_layout_method - case defined?(@_layout) ? @_layout : nil + case @_layout when String self.class_eval %{def _layout(details) #{@_layout.inspect} end} when Symbol -- cgit v1.2.3 From 631a27d6a51b0f9b11c8cc2165cae70bcd8134dd Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 10 Nov 2009 16:15:43 -0800 Subject: Revert "Revert "Eliminate warning with layout is unset"" This reverts commit d8fd0499bfd6edc676ff3fbffc327656f6d5c320. --- actionpack/lib/abstract_controller/layouts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/abstract_controller') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 1616f8030a..c71cef42b2 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -100,7 +100,7 @@ module AbstractController # name, return that string. Otherwise, use the superclass' # layout (which might also be implied) def _write_layout_method - case @_layout + case defined?(@_layout) ? @_layout : nil when String self.class_eval %{def _layout(details) #{@_layout.inspect} end} when Symbol -- cgit v1.2.3