diff options
author | Xavier Noria <fxn@hashref.com> | 2012-01-24 07:55:13 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-01-24 07:55:13 -0800 |
commit | 2580696c4903c19e5021ee4a8208224564a3bf39 (patch) | |
tree | e6756709a369a2587e6440859a99d818f36fd723 /activeresource | |
parent | 352159888bfdcb7cd6aa336187a2b4ab68795912 (diff) | |
parent | 4e79deff898737ec5985f531923933434ed19477 (diff) | |
download | rails-2580696c4903c19e5021ee4a8208224564a3bf39.tar.gz rails-2580696c4903c19e5021ee4a8208224564a3bf39.tar.bz2 rails-2580696c4903c19e5021ee4a8208224564a3bf39.zip |
Merge pull request #4636 from sachin87/code_improved
code improved with better condition
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/lib/active_resource/http_mock.rb | 9 |
1 files changed, 3 insertions, 6 deletions
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, |