mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
extract response setting to a method
This commit is contained in:
parent
b7a4fe18f2
commit
46eba6c30f
1 changed files with 8 additions and 2 deletions
|
@ -9,8 +9,7 @@ module ActionController
|
||||||
:status, :location, :content_type, :to => "@_response"
|
:status, :location, :content_type, :to => "@_response"
|
||||||
|
|
||||||
def dispatch(action, request)
|
def dispatch(action, request)
|
||||||
@_response = ActionDispatch::Response.new
|
set_response!(request)
|
||||||
@_response.request = request
|
|
||||||
super(action, request)
|
super(action, request)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,5 +21,12 @@ module ActionController
|
||||||
def reset_session
|
def reset_session
|
||||||
@_request.reset_session
|
@_request.reset_session
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def set_response!(request)
|
||||||
|
@_response = ActionDispatch::Response.new
|
||||||
|
@_response.request = request
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue