do not delete uuid if provided in new object (notably collection)
authorTom Clegg <tom@clinicalfuture.com>
Tue, 12 Feb 2013 21:11:30 +0000 (14:11 -0700)
committerTom Clegg <tom@clinicalfuture.com>
Tue, 12 Feb 2013 21:11:30 +0000 (14:11 -0700)
app/models/orvos_base.rb

index 3f45c4a995b5f27fb75b72055c16aa13c0bcc60e..1c6a7301fcf89a399011bba8d8c7b14dc37f82fa 100644 (file)
@@ -77,10 +77,10 @@ class OrvosBase < ActiveRecord::Base
       obdata[col.name.to_sym] = self.send(col.name.to_sym)
     end
     obdata.delete :id
-    obdata.delete :uuid
     postdata = { self.class.to_s.underscore => obdata }
     if etag
       postdata['_method'] = 'PUT'
+      obdata.delete :uuid
       resp = $orvos_api_client.api(self.class, '/' + uuid, postdata)
     else
       resp = $orvos_api_client.api(self.class, '', postdata)