Permalink
Browse files

ActionController::Metal doesn't have logger method, check it and then…

… delegate
  • Loading branch information...
route committed Jun 5, 2012
1 parent a8e22ae commit 3b1ea3d896a6a1ebefdf3fcd461396ddbf8df230
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionpack/lib/action_view/helpers/controller_helper.rb
@@ -10,14 +10,16 @@ module ControllerHelper #:nodoc:
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
+ controller.logger if controller.respond_to?(:logger)
+ end
end
end
end

0 comments on commit 3b1ea3d

Please sign in to comment.