Permalink
Browse files

If I want to set respond_body to nil then it

should be nil and not [nil]. If anything other
than nil then wrap it in array

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 7927fc2 commit c1145d9281c8deee2a58a96a32f2e3218a7c28be Neeraj Singh committed with josevalim Jan 22, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/metal.rb
View
2 actionpack/lib/action_controller/metal.rb
@@ -133,7 +133,7 @@ def status=(status)
end
def response_body=(val)
- body = val.respond_to?(:each) ? val : [val]
+ body = val.nil? ? nil : (val.respond_to?(:each) ? val : [val])
super body
end

0 comments on commit c1145d9

Please sign in to comment.