diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-19 18:25:52 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-19 18:25:52 -0200 |
commit | 1b4edd173dc2cbe53e48777d3e17be3164513539 (patch) | |
tree | 9ef1dda909373e556c8ccec5664196ed2f5536e3 /actionpack/lib/action_controller | |
parent | 0a3f57e85a0825f31d93303eb6f2c7f40fce57f8 (diff) | |
download | rails-1b4edd173dc2cbe53e48777d3e17be3164513539.tar.gz rails-1b4edd173dc2cbe53e48777d3e17be3164513539.tar.bz2 rails-1b4edd173dc2cbe53e48777d3e17be3164513539.zip |
Use performed? instead of checking for response_body
* Check for performed? instead of response_body
* Change performed? to return a boolean
* Refactor AC::Metal#response_body= to reuse variable
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal.rb | 8 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/implicit_render.rb | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index 691fb24d0f..92433ab462 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -181,13 +181,13 @@ module ActionController @_status = Rack::Utils.status_code(status) end - def response_body=(val) - body = (val.nil? || val.respond_to?(:each)) ? val : [val] - super body + def response_body=(body) + body = [body] unless body.nil? || body.respond_to?(:each) + super end def performed? - response_body + !!response_body end def dispatch(name, request) #:nodoc: diff --git a/actionpack/lib/action_controller/metal/implicit_render.rb b/actionpack/lib/action_controller/metal/implicit_render.rb index e8e465d3ba..ae04b53825 100644 --- a/actionpack/lib/action_controller/metal/implicit_render.rb +++ b/actionpack/lib/action_controller/metal/implicit_render.rb @@ -2,7 +2,7 @@ module ActionController module ImplicitRender def send_action(method, *args) ret = super - default_render unless response_body + default_render unless performed? ret end |