aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-08-09 15:14:00 +0200
committerXavier Noria <fxn@hashref.com>2010-08-09 15:25:21 +0200
commit4f7565c4de1f877547a6b901a8416b18c613acc9 (patch)
tree4b38fceff3eb16aeb9a320a572351de405e0fb98 /activeresource
parent505546af709082f25444e323ee0f2141a86bbc63 (diff)
downloadrails-4f7565c4de1f877547a6b901a8416b18c613acc9.tar.gz
rails-4f7565c4de1f877547a6b901a8416b18c613acc9.tar.bz2
rails-4f7565c4de1f877547a6b901a8416b18c613acc9.zip
adds missing requires for Object#try
Diffstat (limited to 'activeresource')
-rw-r--r--activeresource/lib/active_resource/http_mock.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb
index f192c53b4f..75425c01c0 100644
--- a/activeresource/lib/active_resource/http_mock.rb
+++ b/activeresource/lib/active_resource/http_mock.rb
@@ -123,7 +123,11 @@ module ActiveResource
# def post(path, body, headers)
# request = ActiveResource::Request.new(:post, path, body, headers)
# self.class.requests << request
- # self.class.responses.assoc(request).try(:second) || raise(InvalidRequestError.new("No response recorded for #{request}"))
+ # if response = self.class.responses.assoc(request)
+ # response[1]
+ # else
+ # raise InvalidRequestError.new("No response recorded for #{request}")
+ # end
# end
module_eval <<-EOE, __FILE__, __LINE__ + 1
def #{method}(path, #{'body, ' if has_body}headers)