aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2013-11-12 01:57:21 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2013-11-14 15:46:43 -0800
commit0f33d70e89991711ff8b3dde134a61f4a5a0ec06 (patch)
treedf93bc8ab410476175fd07f61105ff09ad86084a /activesupport/CHANGELOG.md
parent07996ebc50f5906dbecc481ac83ed2adefc9ec6e (diff)
downloadrails-0f33d70e89991711ff8b3dde134a61f4a5a0ec06.tar.gz
rails-0f33d70e89991711ff8b3dde134a61f4a5a0ec06.tar.bz2
rails-0f33d70e89991711ff8b3dde134a61f4a5a0ec06.zip
Improved compatibility with the stdlib JSON gem.
Previously, calling `::JSON.{generate,dump}` sometimes causes unexpected failures such as intridea/multi_json#86. `::JSON.{generate,dump}` now bypasses the ActiveSupport JSON encoder completely and yields the same result with or without ActiveSupport. This means that it will **not** call `as_json` and will ignore any options that the JSON gem does not natively understand. To invoke ActiveSupport's JSON encoder instead, use `obj.to_json(options)` or `ActiveSupport::JSON.encode(obj, options)`.
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r--activesupport/CHANGELOG.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index ee05ea3255..bb66b0ffa2 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,17 @@
+* Improved compatibility with the stdlib JSON gem.
+
+ Previously, calling `::JSON.{generate,dump}` sometimes causes unexpected
+ failures such as intridea/multi_json#86.
+
+ `::JSON.{generate,dump}` now bypasses the ActiveSupport JSON encoder
+ completely and yields the same result with or without ActiveSupport. This
+ means that it will **not** call `as_json` and will ignore any options that
+ the JSON gem does not natively understand. To invoke ActiveSupport's JSON
+ encoder instead, use `obj.to_json(options)` or
+ `ActiveSupport::JSON.encode(obj, options)`.
+
+ *Godfrey Chan*
+
* Fix Active Support `Time#to_json` and `DateTime#to_json` to return 3 decimal
places worth of fractional seconds, similar to `TimeWithZone`.