diff options
author | José Valim <jose.valim@gmail.com> | 2011-11-10 00:49:14 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-11-10 00:49:14 -0800 |
commit | d2cfa982fde089c4f74f830c9c02891c93cf21e5 (patch) | |
tree | 589afa6ee972cf1ba8a529dce06207c2f20751e7 /actionpack/lib/action_controller/metal.rb | |
parent | a625523e755421b0f96fe5b0a885462ef51582b1 (diff) | |
parent | be7ab83b647c1ebb619b88854d310497075ea58f (diff) | |
download | rails-d2cfa982fde089c4f74f830c9c02891c93cf21e5.tar.gz rails-d2cfa982fde089c4f74f830c9c02891c93cf21e5.tar.bz2 rails-d2cfa982fde089c4f74f830c9c02891c93cf21e5.zip |
Merge pull request #3581 from amatsuda/metal_response_body_19
AC::Metal#response_body= stores different value in Ruby 1.8 and 1.9
Diffstat (limited to 'actionpack/lib/action_controller/metal.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index 0133b2ecbc..125dbf6bb5 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -182,7 +182,13 @@ module ActionController end def response_body=(val) - body = val.nil? ? nil : (val.respond_to?(:each) ? val : [val]) + body = if val.is_a?(String) + [val] + elsif val.nil? || val.respond_to?(:each) + val + else + [val] + end super body end |