From bfda4cdc5a0ac1b8e846f0838eca36075b3be987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Fri, 8 Jun 2007 19:32:15 +0000 Subject: Fixed query methods on resources. [Cody Fauser] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6972 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activeresource/CHANGELOG | 2 ++ activeresource/lib/active_resource/base.rb | 2 +- activeresource/test/base_test.rb | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/activeresource/CHANGELOG b/activeresource/CHANGELOG index 35321a2f4f..08a4e6a56b 100644 --- a/activeresource/CHANGELOG +++ b/activeresource/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix query methods on resources. [Cody Fauser] + * pass the prefix_options to the instantiated record when using find without a specific id. Closes #8544 [alloy] * Recognize and raise an exception on 405 Method Not Allowed responses. #7692 [Josh Peek] diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index 3048aa5b89..78d1c0033a 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -415,7 +415,7 @@ module ActiveResource when "=" attributes[method_name.first(-1)] = arguments.first when "?" - attributes[method_name.first(-1)] == true + attributes[method_name.first(-1)] else attributes.has_key?(method_name) ? attributes[method_name] : super end diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb index bf73732c8f..6c924447de 100644 --- a/activeresource/test/base_test.rb +++ b/activeresource/test/base_test.rb @@ -181,6 +181,7 @@ class BaseTest < Test::Unit::TestCase matz = Person.find(1) assert_kind_of Person, matz assert_equal "Matz", matz.name + assert matz.name? end def test_respond_to -- cgit v1.2.3