diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-14 04:45:10 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-14 04:45:10 -0800 |
commit | 1919a303f98619d636f17b7fb736967ffdd35972 (patch) | |
tree | 65ea7eb85d304627877799380998ee6879aeb3ca /actionpack | |
parent | 591fcbafcd2eea58ac2ede2bb4daed8c713d07da (diff) | |
parent | 6f3420c0375bb6308b60c2d8df676aabf463a7cb (diff) | |
download | rails-1919a303f98619d636f17b7fb736967ffdd35972.tar.gz rails-1919a303f98619d636f17b7fb736967ffdd35972.tar.bz2 rails-1919a303f98619d636f17b7fb736967ffdd35972.zip |
Merge pull request #4463 from nashby/refactor-response_body
refactor response_body= method
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/metal.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index 125dbf6bb5..3aab77a069 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -182,13 +182,7 @@ module ActionController end def response_body=(val) - body = if val.is_a?(String) - [val] - elsif val.nil? || val.respond_to?(:each) - val - else - [val] - end + body = (val.nil? || val.respond_to?(:each)) ? val : [val] super body end |