aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2013-05-11 22:49:58 -0700
committerYehuda Katz <wycats@gmail.com>2013-05-11 22:49:58 -0700
commita395c22fd3f55040c041a330c14b3676bfee29fc (patch)
treea0d5b9d0173eff0adbd6854e7c6e0ad0c3f6c824 /activesupport/lib/active_support
parent98ade30e421e2c9e405060bba87ecbd092f11698 (diff)
parentce4456fde6f45f1abd020cbdeb520d401299e01f (diff)
downloadrails-a395c22fd3f55040c041a330c14b3676bfee29fc.tar.gz
rails-a395c22fd3f55040c041a330c14b3676bfee29fc.tar.bz2
rails-a395c22fd3f55040c041a330c14b3676bfee29fc.zip
Merge pull request #10576 from sferik/remove_multi_json_dependency
Replace multi_json with json
Diffstat (limited to 'activesupport/lib/active_support')
-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