Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor response_body= method

response_to?(:each) returns false for strings in ruby 1.9, so there is no need for these checks
  • Loading branch information...
commit 6f3420c0375bb6308b60c2d8df676aabf463a7cb 1 parent 591fcba
@nashby nashby authored
Showing with 1 addition and 7 deletions.
  1. +1 −7 actionpack/lib/action_controller/metal.rb
View
8 actionpack/lib/action_controller/metal.rb
@@ -182,13 +182,7 @@ def status=(status)
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
Please sign in to comment.
Something went wrong with that request. Please try again.