Permalink
Browse files

extract response setting to a method

  • Loading branch information...
1 parent b7a4fe1 commit 46eba6c30ff05b5f7e8e6015e33ddf0a385fce6f @tenderlove tenderlove committed Jul 2, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 actionpack/lib/action_controller/metal/rack_delegation.rb
@@ -9,8 +9,7 @@ module RackDelegation
:status, :location, :content_type, :to => "@_response"
def dispatch(action, request)
- @_response = ActionDispatch::Response.new
- @_response.request = request
+ set_response!(request)
super(action, request)
end
@@ -22,5 +21,12 @@ def response_body=(body)
def reset_session
@_request.reset_session
end
+
+ private
+
+ def set_response!(request)
+ @_response = ActionDispatch::Response.new
+ @_response.request = request
+ end
end
end

0 comments on commit 46eba6c

Please sign in to comment.