Permalink
Browse files

Fix deprecated MultiJson calls

  • Loading branch information...
1 parent fddbf37 commit 3f2a1933742ec965b1eee6216e2e0a8772273b21 @MSch MSch committed Apr 18, 2012
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 3f2a193

Please sign in to comment.