Permalink
Browse files

Merge pull request #168 from MSch/multi_json-deprecations

Fix deprecated MultiJson calls
  • Loading branch information...
igrigorik committed Apr 19, 2012
2 parents fddbf37 + 3f2a193 commit 11c996b062053821a027d59513b5644ed0ce1e1f
View
@@ -7,7 +7,7 @@
class CustomJSON
def coerce(value, opts={})
begin
- MultiJson.decode(value)
+ MultiJson.load(value)
rescue
return opts[:default] if opts[:default]
raise Goliath::Rack::Validation::FailedCoerce.new([400, {}, "Invalid JSON"])
@@ -13,7 +13,7 @@ class JSON
def post_process(env, status, headers, body)
if json_response?(headers)
- body = [MultiJson.encode(body)]
+ body = [MultiJson.dump(body)]
end
[status, headers, body]
end
@@ -31,7 +31,7 @@ def retrieve_params(env)
when URL_ENCODED then
::Rack::Utils.parse_nested_query(body)
when JSON_ENCODED then
- MultiJson.decode(body)
+ MultiJson.load(body)
else
{}
end
@@ -17,7 +17,7 @@ def initialize(error)
#
# class CustomJSON
# def coerce(value, opts={})
- # MultiJson.decode(value)
+ # MultiJson.load(value)
# end
# end
#

0 comments on commit 11c996b

Please sign in to comment.