Permalink
Browse files

Merge pull request #4636 from sachin87/code_improved

code improved with better condition
  • Loading branch information...
2 parents 3521598 + 4e79def commit 2580696c4903c19e5021ee4a8208224564a3bf39 @fxn fxn committed Jan 24, 2012
Showing with 3 additions and 6 deletions.
  1. +3 −6 activeresource/lib/active_resource/http_mock.rb
@@ -291,12 +291,9 @@ def initialize(body, message = 200, headers = {})
if resp_cls && !resp_cls.body_permitted?
@body = nil
end
-
- if @body.nil?
- self['Content-Length'] = "0"
- else
- self['Content-Length'] = body.size.to_s
- end
+
+ self['Content-Length'] = @body.nil? ? "0" : body.size.to_s
+
end
# Returns true if code is 2xx,

0 comments on commit 2580696

Please sign in to comment.