From 66650dbd05adbf7dbe69d8f7ac15d7a5440c50ca Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Mon, 4 Feb 2013 10:45:01 -0500 Subject: [PATCH] Switch to MultiJson which uses Oj under the hood (since it is available). --- Gemfile | 1 + Gemfile.lock | 1 + app/models/orvos_api_client.rb | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index e6a278ce24..e467f5fd7a 100644 --- 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 diff --git a/Gemfile.lock b/Gemfile.lock index ca2aa31471..0df7189413 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -140,6 +140,7 @@ DEPENDENCIES anjlab-bootstrap-rails (>= 2.2) coffee-rails (~> 3.2.1) jquery-rails + multi_json oj passenger pg diff --git a/app/models/orvos_api_client.rb b/app/models/orvos_api_client.rb index 77c4912984..0e57cfd76f 100644 --- a/app/models/orvos_api_client.rb +++ b/app/models/orvos_api_client.rb @@ -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 -- 2.30.2