aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorErik Michaels-Ober <sferik@gmail.com>2013-05-11 13:59:37 -0700
committerErik Michaels-Ober <sferik@gmail.com>2013-05-11 21:43:48 -0700
commitce4456fde6f45f1abd020cbdeb520d401299e01f (patch)
treea0d5b9d0173eff0adbd6854e7c6e0ad0c3f6c824 /activesupport/lib
parent98ade30e421e2c9e405060bba87ecbd092f11698 (diff)
downloadrails-ce4456fde6f45f1abd020cbdeb520d401299e01f.tar.gz
rails-ce4456fde6f45f1abd020cbdeb520d401299e01f.tar.bz2
rails-ce4456fde6f45f1abd020cbdeb520d401299e01f.zip
Replace multi_json with json
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/json/decoding.rb25
1 files changed, 4 insertions, 21 deletions
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb
index a4a32b2ad0..30833a4cb1 100644
--- a/activesupport/lib/active_support/json/decoding.rb
+++ b/activesupport/lib/active_support/json/decoding.rb
@@ -1,6 +1,6 @@
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/module/delegation'
-require 'multi_json'
+require 'json'
module ActiveSupport
# Look for and parse json strings that look like ISO 8601 times.
@@ -13,8 +13,8 @@ module ActiveSupport
#
# ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}")
# => {"team" => "rails", "players" => "36"}
- def decode(json, options ={})
- data = MultiJson.load(json, options)
+ def decode(json, proc = nil, options = {})
+ data = ::JSON.load(json, proc, options)
if ActiveSupport.parse_json_times
convert_dates_from(data)
else
@@ -22,23 +22,6 @@ module ActiveSupport
end
end
- def engine
- MultiJson.adapter
- end
- alias :backend :engine
-
- def engine=(name)
- MultiJson.use(name)
- end
- alias :backend= :engine=
-
- def with_backend(name)
- old_backend, self.backend = backend, name
- yield
- ensure
- self.backend = old_backend
- end
-
# Returns the class of the error that will be raised when there is an
# error in decoding JSON. Using this method means you won't directly
# depend on the ActiveSupport's JSON implementation, in case it changes
@@ -50,7 +33,7 @@ module ActiveSupport
# Rails.logger.warn("Attempted to decode invalid JSON: #{some_string}")
# end
def parse_error
- MultiJson::DecodeError
+ ::JSON::ParserError
end
private