[ARVADOS] updated: 6779e6dd8bd666a5f398345e88c077dccca901ea

git at public.curoverse.com git at public.curoverse.com
Fri Jan 24 11:47:38 EST 2014


Summary of changes:
 .../api/app/controllers/application_controller.rb  |   17 ++++++++++++-----
 services/api/db/schema.rb                          |    2 +-
 2 files changed, 13 insertions(+), 6 deletions(-)

       via  6779e6dd8bd666a5f398345e88c077dccca901ea (commit)
       via  9698348290b7cdf762eecc6d3d365657e2930f14 (commit)
       via  746240ca83082eb1066a1bfd35823c71708dc6ec (commit)
      from  b509e32fbef0ff346c26669a22b87576390285ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 6779e6dd8bd666a5f398345e88c077dccca901ea
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jan 24 08:45:17 2014 -0800

    Update schema migration version.

diff --git a/services/api/db/schema.rb b/services/api/db/schema.rb
index 976c2a7..99b6129 100644
--- a/services/api/db/schema.rb
+++ b/services/api/db/schema.rb
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20131007180607) do
+ActiveRecord::Schema.define(:version => 20140117231056) do
 
   create_table "api_client_authorizations", :force => true do |t|
     t.string   "api_token",                                           :null => false

commit 9698348290b7cdf762eecc6d3d365657e2930f14
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jan 24 08:36:00 2014 -0800

    Always accept properties and info as serialized attributes.
    
    refs #1944
    refs #1987

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index a11a75f..62ed762 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -339,6 +339,8 @@ class ApplicationController < ActionController::Base
   def self.accept_attribute_as_json(attr, force_class=nil)
     before_filter lambda { accept_attribute_as_json attr, force_class }
   end
+  accept_attribute_as_json :properties, Hash
+  accept_attribute_as_json :info, Hash
   def accept_attribute_as_json(attr, force_class)
     if params[resource_name] and resource_attrs.is_a? Hash
       if resource_attrs[attr].is_a? String

commit 746240ca83082eb1066a1bfd35823c71708dc6ec
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jan 24 08:35:08 2014 -0800

    Always use string keys instead of symbol keys for serialized attributes.
    
    refs #1944
    refs #1987

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 4ec0241..a11a75f 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -340,13 +340,18 @@ class ApplicationController < ActionController::Base
     before_filter lambda { accept_attribute_as_json attr, force_class }
   end
   def accept_attribute_as_json(attr, force_class)
-    if params[resource_name].is_a? Hash
-      if params[resource_name][attr].is_a? String
-        params[resource_name][attr] = Oj.load(params[resource_name][attr],
-                                              symbol_keys: true)
-        if force_class and !params[resource_name][attr].is_a? force_class
+    if params[resource_name] and resource_attrs.is_a? Hash
+      if resource_attrs[attr].is_a? String
+        resource_attrs[attr] = Oj.load(resource_attrs[attr],
+                                       symbol_keys: false)
+        if force_class and !resource_attrs[attr].is_a? force_class
           raise TypeError.new("#{resource_name}[#{attr.to_s}] must be a #{force_class.to_s}")
         end
+      elsif resource_attrs[attr].is_a? Hash
+        # Convert symbol keys to strings (in hashes provided by
+        # resource_attrs)
+        resource_attrs[attr] = resource_attrs[attr].
+          with_indifferent_access.to_hash
       end
     end
   end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list