Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Metal controller doesn't have logger method, check it and then delegate

  • Loading branch information...
commit ccaf982ad8e2b9859d398387e483901f60fedd69 1 parent d10eb69
@route route authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 actionpack/lib/action_view/helpers/controller_helper.rb
View
10 actionpack/lib/action_view/helpers/controller_helper.rb
@@ -10,14 +10,20 @@ 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
+ if controller.respond_to?(:logger)
+ controller.logger
+ else
+ nil
+ end
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.