diff options
author | Jacques Crocker <railsjedi@gmail.com> | 2010-09-18 20:21:03 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-25 11:15:40 +0200 |
commit | ee5ef67c443407f616feef3a8cade8ba3a9d6ef0 (patch) | |
tree | 5a3adcaa9837d2638d88bd9ebbe915c98e15e2bf /activeresource/test/cases/base | |
parent | 1b7d30bfc925562cffff10db2a0388770e9bc06c (diff) | |
download | rails-ee5ef67c443407f616feef3a8cade8ba3a9d6ef0.tar.gz rails-ee5ef67c443407f616feef3a8cade8ba3a9d6ef0.tar.bz2 rails-ee5ef67c443407f616feef3a8cade8ba3a9d6ef0.zip |
Allow ActiveResource to work with non-generated ids [#5660 state:resolved]
This commit updates new? so that it knows whether or not the record was actually new or not, and doesn't rely solely on the presence of id. This enables the ability to set a custom primary_key that is not autogenerated by the server.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/test/cases/base')
-rw-r--r-- | activeresource/test/cases/base/custom_methods_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activeresource/test/cases/base/custom_methods_test.rb b/activeresource/test/cases/base/custom_methods_test.rb index 459d33c24f..0fbf94bc0e 100644 --- a/activeresource/test/cases/base/custom_methods_test.rb +++ b/activeresource/test/cases/base/custom_methods_test.rb @@ -91,7 +91,7 @@ class CustomMethodsTest < Test::Unit::TestCase 201, {'Location' => '/people/1/addresses/2.xml'}), addy.post(:link) - matz = Person.new(:id => 1, :name => 'Matz') + matz = Person.find(1) assert_equal ActiveResource::Response.new(@matz, 201), matz.post(:register) end |