From e7a305f08d8f72f81449e1d8934fba31f038ad88 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 2 Jun 2008 21:58:42 -0500 Subject: [PATCH] Fixed Base#exists? to check status code as integer [#299 state:resolved] (Wes Oldenbeuving) --- activeresource/CHANGELOG | 5 +++++ activeresource/lib/active_resource/base.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/activeresource/CHANGELOG b/activeresource/CHANGELOG index e124e40dd1336..673e20de28658 100644 --- a/activeresource/CHANGELOG +++ b/activeresource/CHANGELOG @@ -1,3 +1,8 @@ +*Edge* + +* Fixed Base#exists? to check status code as integer [#299 state:resolved] (Wes Oldenbeuving) + + *2.1.0 (May 31st, 2008)* * Fixed response logging to use length instead of the entire thing (seangeo) [#27] diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index 463ee9f1e724e..55dacfdf06929 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -538,7 +538,7 @@ def exists?(id, options = {}) prefix_options, query_options = split_options(options[:params]) path = element_path(id, prefix_options, query_options) response = connection.head(path, headers) - response.code == 200 + response.code.to_i == 200 end # id && !find_single(id, options).nil? rescue ActiveResource::ResourceNotFound