ignore client-provided kind and etag during update
authorTom Clegg <tom@clinicalfuture.com>
Mon, 3 Jun 2013 19:52:30 +0000 (15:52 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Mon, 3 Jun 2013 20:50:55 +0000 (16:50 -0400)
services/api/app/controllers/application_controller.rb

index e62d8cdf914d2ce66e32e756ce8d7db596b3c7f0..3c436a708e88885415cb6daf76f4a4df0d672020 100644 (file)
@@ -38,7 +38,8 @@ class ApplicationController < ActionController::Base
   end
 
   def update
-    if @object.update_attributes resource_attrs
+    attrs_to_update = resource_attrs.reject { |k,v| [:kind,:etag].index k }
+    if @object.update_attributes attrs_to_update
       show
     else
       render json: { errors: @object.errors.full_messages }, status: 422