diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-02 14:01:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 14:59:31 -0700 |
commit | 46eba6c30ff05b5f7e8e6015e33ddf0a385fce6f (patch) | |
tree | ffffd2869637c6b747e3cbabb045be7a0f6b7e00 /actionpack/lib/action_controller | |
parent | b7a4fe18f2cee1385e7dcd36016fb6a15b93aef6 (diff) | |
download | rails-46eba6c30ff05b5f7e8e6015e33ddf0a385fce6f.tar.gz rails-46eba6c30ff05b5f7e8e6015e33ddf0a385fce6f.tar.bz2 rails-46eba6c30ff05b5f7e8e6015e33ddf0a385fce6f.zip |
extract response setting to a method
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/rack_delegation.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/rack_delegation.rb b/actionpack/lib/action_controller/metal/rack_delegation.rb index f01f4b99a9..bdf6e88699 100644 --- a/actionpack/lib/action_controller/metal/rack_delegation.rb +++ b/actionpack/lib/action_controller/metal/rack_delegation.rb @@ -9,8 +9,7 @@ module ActionController :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 @@ module ActionController def reset_session @_request.reset_session end + + private + + def set_response!(request) + @_response = ActionDispatch::Response.new + @_response.request = request + end end end |