Switch to MultiJson which uses Oj under the hood (since it is available).
authorWard Vandewege <ward@clinicalfuture.com>
Mon, 4 Feb 2013 15:45:01 +0000 (10:45 -0500)
committerWard Vandewege <ward@clinicalfuture.com>
Mon, 4 Feb 2013 15:45:01 +0000 (10:45 -0500)
Gemfile
Gemfile.lock
app/models/orvos_api_client.rb

diff --git a/Gemfile b/Gemfile
index e6a278ce24cb0f7c758a197ca882156319f94fae..e467f5fd7a1e07b38cfb85d6b8bbca1805e7167b 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -8,6 +8,7 @@ gem 'rails', '3.2.11'
 gem 'sqlite3'
 gem 'pg'
 
+gem 'multi_json'
 gem 'oj'
 
 # Gems used only for assets and not required
index ca2aa3147157ee46ba2f68622dda1adb2e43803d..0df71894137f3e24ad6ba02820f1440ac827f341 100644 (file)
@@ -140,6 +140,7 @@ DEPENDENCIES
   anjlab-bootstrap-rails (>= 2.2)
   coffee-rails (~> 3.2.1)
   jquery-rails
+  multi_json
   oj
   passenger
   pg
index 77c49129840ff16344e31f7de485d4e5f3ddebab..0e57cfd76ff2f0fb3104fa8c47dd96c0b3944d8d 100644 (file)
@@ -16,7 +16,7 @@ class OrvosApiClient
         elsif v == true or v == false
           dataargs << "#{k}=#{v ? 1 : 0}"
         else
-          dataargs << "#{k}=#{Oj.dump(v)}"
+          dataargs << "#{k}=#{MultiJson.dump(v)}"
         end
       end
     else
@@ -33,7 +33,7 @@ class OrvosApiClient
              'r') do |io|
       json = io.read
     end
-    resp = Oj.load json, :symbolize_names => true
+    resp = MultiJson.load(json, :symbolize_keys => true)
     if resp[:errors]
       if resp[:errors][0] == 'Not logged in'
         raise NotLoggedInException.new