Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #12792 from chancancode/move_json_requires

Move the JSON extension require statements to the right place.
  • Loading branch information...
commit 9348fb6b1746aa0fed122e8f60b759025e242e2b 2 parents 240863a + 0b7c6d5
@rafaelfranca rafaelfranca authored
7 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,
8 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=,
Please sign in to comment.
Something went wrong with that request. Please try again.