diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2013-11-19 19:17:55 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2013-11-26 09:51:51 -0800 |
commit | 4d02296cfbd69b4d2757dfd20f23d778bb23b81b (patch) | |
tree | 8199425bb07b4e92ba4cfa986f2059989ce0b552 /activesupport/lib/active_support/json | |
parent | ca12db0efbf07c1a3182556e99af4ebbfcd59dee (diff) | |
download | rails-4d02296cfbd69b4d2757dfd20f23d778bb23b81b.tar.gz rails-4d02296cfbd69b4d2757dfd20f23d778bb23b81b.tar.bz2 rails-4d02296cfbd69b4d2757dfd20f23d778bb23b81b.zip |
Removed support for encoding BigDecimal as a JSON number
This is because the new encoder will no longer support encode_json.
Therefore our only choice is to return `to_i` or `to_s` in
`BigDecimal#as_json`. Since casting a BigDecimal to an integer is
most likely a lossy operation, we chose to encode it as a string.
Support for encoding BigDecimal as a string will return via the
`activesupport-json_encoder` gem.
Diffstat (limited to 'activesupport/lib/active_support/json')
-rw-r--r-- | activesupport/lib/active_support/json/encoding.rb | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index 0e1c379b5b..5fad5887c6 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -7,7 +7,6 @@ module ActiveSupport class << self delegate :use_standard_json_time_format, :use_standard_json_time_format=, :escape_html_entities_in_json, :escape_html_entities_in_json=, - :encode_big_decimal_as_string, :encode_big_decimal_as_string=, :to => :'ActiveSupport::JSON::Encoding' end @@ -69,10 +68,6 @@ module ActiveSupport # to the Active Support legacy format. attr_accessor :use_standard_json_time_format - # If false, serializes BigDecimal objects as numeric instead of wrapping - # them in a string. - attr_accessor :encode_big_decimal_as_string - attr_accessor :escape_regex attr_reader :escape_html_entities_in_json @@ -118,7 +113,6 @@ module ActiveSupport self.use_standard_json_time_format = true self.escape_html_entities_in_json = true - self.encode_big_decimal_as_string = true end end end |