From ccaf982ad8e2b9859d398387e483901f60fedd69 Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Tue, 5 Jun 2012 11:03:00 +0400 Subject: Metal controller doesn't have logger method, check it and then delegate --- actionpack/lib/action_view/helpers/controller_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/controller_helper.rb b/actionpack/lib/action_view/helpers/controller_helper.rb index 1a583e62ae..0c3806a78c 100644 --- a/actionpack/lib/action_view/helpers/controller_helper.rb +++ b/actionpack/lib/action_view/helpers/controller_helper.rb @@ -10,14 +10,20 @@ module ActionView delegate :request_forgery_protection_token, :params, :session, :cookies, :response, :headers, :flash, :action_name, :controller_name, :controller_path, :to => :controller - delegate :logger, :to => :controller, :allow_nil => true - def assign_controller(controller) if @_controller = controller @_request = controller.request if controller.respond_to?(:request) @_config = controller.config.inheritable_copy if controller.respond_to?(:config) end end + + def logger + if controller.respond_to?(:logger) + controller.logger + else + nil + end + end end end end -- cgit v1.2.3