aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2013-10-31 13:41:46 +0100
committerRobin Dupret <robin.dupret@gmail.com>2013-10-31 13:46:23 +0100
commite3d775f00a9cbe28e1647b39ed0fb41d5168c5e1 (patch)
tree009cb757593781f5087b049b0dd4fab2f50cec32 /activesupport
parent9d6d07ddf46024f3af71c386c69b2af9f70de32a (diff)
downloadrails-e3d775f00a9cbe28e1647b39ed0fb41d5168c5e1.tar.gz
rails-e3d775f00a9cbe28e1647b39ed0fb41d5168c5e1.tar.bz2
rails-e3d775f00a9cbe28e1647b39ed0fb41d5168c5e1.zip
Require time before monkey-patching it
Same as #12710 but for the time module this time. This time it should fix the Active Model test suite in isolation avoiding a TypeError to be raised about the superclass of the DateTime object.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/object/json.rb1
-rw-r--r--activesupport/lib/active_support/json/encoding.rb1
2 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/json.rb b/activesupport/lib/active_support/core_ext/object/json.rb
index 8586d7eb16..554da1a2aa 100644
--- a/activesupport/lib/active_support/core_ext/object/json.rb
+++ b/activesupport/lib/active_support/core_ext/object/json.rb
@@ -1,6 +1,7 @@
# Hack to load json gem first so we can overwrite its to_json.
require 'json'
require 'bigdecimal'
+require 'time'
# 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 5f58068617..4d73672047 100644
--- a/activesupport/lib/active_support/json/encoding.rb
+++ b/activesupport/lib/active_support/json/encoding.rb
@@ -7,7 +7,6 @@ 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'