Skip to content
Browse files

Require bigdecimal before monkey-patching it

If we try to monkey-patch the class before requiring it, then a
"superclass mismatch" (TypeError) error is raised and the build can't
run correctly.

Fixes #12708
  • Loading branch information...
1 parent 6e5d409 commit 9d6d07ddf46024f3af71c386c69b2af9f70de32a @robin850 robin850 committed Oct 31, 2013
View
1 activesupport/lib/active_support/core_ext/object/json.rb
@@ -1,5 +1,6 @@
# Hack to load json gem first so we can overwrite its to_json.
require 'json'
+require 'bigdecimal'
# 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,
View
1 activesupport/lib/active_support/json/encoding.rb
@@ -3,7 +3,6 @@
require 'active_support/core_ext/object/json'
require 'active_support/core_ext/module/delegation'
-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'

0 comments on commit 9d6d07d

Please sign in to comment.
Something went wrong with that request. Please try again.