From 6fee981fa4ea2654f825c58b58327fc15fddf3a6 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 22 Apr 2009 16:48:58 -0700 Subject: Opt in to JSON --- actionpack/lib/action_dispatch/middleware/params_parser.rb | 2 ++ activerecord/lib/active_record/serializers/json_serializer.rb | 2 ++ activeresource/lib/active_resource/formats/json_format.rb | 2 ++ activesupport/lib/active_support.rb | 1 - activesupport/test/json/decoding_test.rb | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index 6df572268c..abaee2829e 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -1,3 +1,5 @@ +require 'active_support/json' + module ActionDispatch class ParamsParser ActionController::Base.param_parsers[Mime::XML] = :xml_simple diff --git a/activerecord/lib/active_record/serializers/json_serializer.rb b/activerecord/lib/active_record/serializers/json_serializer.rb index 1fd65ed006..c709c3f1eb 100644 --- a/activerecord/lib/active_record/serializers/json_serializer.rb +++ b/activerecord/lib/active_record/serializers/json_serializer.rb @@ -1,3 +1,5 @@ +require 'active_support/json' + module ActiveRecord #:nodoc: module Serialization def self.included(base) diff --git a/activeresource/lib/active_resource/formats/json_format.rb b/activeresource/lib/active_resource/formats/json_format.rb index 1d88fc5f16..101027d99e 100644 --- a/activeresource/lib/active_resource/formats/json_format.rb +++ b/activeresource/lib/active_resource/formats/json_format.rb @@ -1,3 +1,5 @@ +require 'active_support/json' + module ActiveResource module Formats module JsonFormat diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb index 84bf372163..5392faa993 100644 --- a/activesupport/lib/active_support.rb +++ b/activesupport/lib/active_support.rb @@ -52,6 +52,5 @@ end require 'active_support/vendor' require 'active_support/dependencies' -require 'active_support/json' I18n.load_path << "#{File.dirname(__FILE__)}/active_support/locale/en.yml" diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb index 7d8a07654d..9b4b207c88 100644 --- a/activesupport/test/json/decoding_test.rb +++ b/activesupport/test/json/decoding_test.rb @@ -1,5 +1,6 @@ # encoding: UTF-8 require 'abstract_unit' +require 'active_support/json' class TestJSONDecoding < ActiveSupport::TestCase TESTS = { -- cgit v1.2.3