From 0b7c6d58c0423d777bde7b69126e2e10c6745137 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Wed, 6 Nov 2013 18:11:39 -0800 Subject: Move the JSON extension require statements to the right place. In #12203, the JSON core extensions were moved into the `core_ext` folder. Unfortunately, there are some corresponding requires that were left behind. The problem is partially addressed in #12710, this commit fixes the rest. --- activesupport/lib/active_support/core_ext/object/json.rb | 7 +++++++ activesupport/lib/active_support/json/encoding.rb | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/object/json.rb b/activesupport/lib/active_support/core_ext/object/json.rb index 34b76e228a..7c8daebd3d 100644 --- a/activesupport/lib/active_support/core_ext/object/json.rb +++ b/activesupport/lib/active_support/core_ext/object/json.rb @@ -1,7 +1,14 @@ # Hack to load json gem first so we can overwrite its to_json. require 'json' require 'bigdecimal' +require 'active_support/core_ext/big_decimal/conversions' # for #to_s +require 'active_support/core_ext/hash/except' +require 'active_support/core_ext/hash/slice' +require 'active_support/core_ext/object/instance_variables' require 'time' +require 'active_support/core_ext/time/conversions' +require 'active_support/core_ext/date_time/conversions' +require 'active_support/core_ext/date/conversions' # The JSON gem adds a few modules to Ruby core classes containing :to_json definition, overwriting # their default behavior. That said, we need to define the basic to_json method in all of them, diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index c9840e9faa..0e1c379b5b 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -3,14 +3,6 @@ require 'active_support/core_ext/object/json' require 'active_support/core_ext/module/delegation' -require 'active_support/core_ext/big_decimal/conversions' # for #to_s -require 'active_support/core_ext/hash/except' -require 'active_support/core_ext/hash/slice' -require 'active_support/core_ext/object/instance_variables' -require 'active_support/core_ext/time/conversions' -require 'active_support/core_ext/date_time/conversions' -require 'active_support/core_ext/date/conversions' - module ActiveSupport class << self delegate :use_standard_json_time_format, :use_standard_json_time_format=, -- cgit v1.2.3