aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/fixtures/subscription_plan.rb
diff options
context:
space:
mode:
authorJacques Crocker <railsjedi@gmail.com>2010-09-18 20:21:03 -0700
committerJosé Valim <jose.valim@gmail.com>2010-09-25 11:15:40 +0200
commitee5ef67c443407f616feef3a8cade8ba3a9d6ef0 (patch)
tree5a3adcaa9837d2638d88bd9ebbe915c98e15e2bf /activeresource/test/fixtures/subscription_plan.rb
parent1b7d30bfc925562cffff10db2a0388770e9bc06c (diff)
downloadrails-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/fixtures/subscription_plan.rb')
-rw-r--r--activeresource/test/fixtures/subscription_plan.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activeresource/test/fixtures/subscription_plan.rb b/activeresource/test/fixtures/subscription_plan.rb
new file mode 100644
index 0000000000..e3c2dd9a74
--- /dev/null
+++ b/activeresource/test/fixtures/subscription_plan.rb
@@ -0,0 +1,5 @@
+class SubscriptionPlan < ActiveResource::Base
+ self.site = "http://37s.sunrise.i:3000"
+ self.element_name = 'plan'
+ self.primary_key = :code
+end