un-serialize data passed by google api client
authorTom Clegg <tom@clinicalfuture.com>
Sat, 5 Jan 2013 02:17:37 +0000 (18:17 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Sat, 5 Jan 2013 02:17:47 +0000 (18:17 -0800)
app/controllers/orvos/v1/collections_controller.rb

index 3a47d14c22503e4bccdf1c4ae492f10beb934c88..ccdf3843032c10a14da3d8ae30f3453956fb3e24 100644 (file)
@@ -47,7 +47,11 @@ class Orvos::V1::CollectionsController < ApplicationController
   # POST /collections
   # POST /collections.json
   def create
-    @collection = Collection.new(params[:collection])
+    if params[:collection].class == String
+      @collection = Collection.new(JSON.parse(params[:collection]))
+    else
+      @collection = Collection.new(params[:collection])
+    end
 
     respond_to do |format|
       if @collection.save