From 4e79deff898737ec5985f531923933434ed19477 Mon Sep 17 00:00:00 2001
From: Sachin87 <singhsachin87@yahoo.com>
Date: Tue, 24 Jan 2012 21:18:37 +0530
Subject: code improved

---
 activeresource/lib/active_resource/http_mock.rb | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

(limited to 'activeresource/lib')

diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb
index 82046a39fb..666b961f87 100644
--- a/activeresource/lib/active_resource/http_mock.rb
+++ b/activeresource/lib/active_resource/http_mock.rb
@@ -291,12 +291,9 @@ module ActiveResource
       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,
-- 
cgit v1.2.3