aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2016-11-13 14:46:21 +0000
committerGitHub <noreply@github.com>2016-11-13 14:46:21 +0000
commitc85d305a67f83f3a92488a641654b85b90b8747a (patch)
treeaccd26754b8b42edf697a44c857359ae421ac5c9 /activesupport/lib/active_support/json
parentdf63abe6d31cdbe426ff6dda9bdd878acc602728 (diff)
parent8776f15b448ed88b1108e70f2de22f0b599818aa (diff)
downloadrails-c85d305a67f83f3a92488a641654b85b90b8747a.tar.gz
rails-c85d305a67f83f3a92488a641654b85b90b8747a.tar.bz2
rails-c85d305a67f83f3a92488a641654b85b90b8747a.zip
Merge pull request #26933 from prathamesh-sonpatki/fix-26877
Fix an issue with JSON encoding of "Infinity" and "NaN" values
Diffstat (limited to 'activesupport/lib/active_support/json')
-rw-r--r--activesupport/lib/active_support/json/encoding.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb
index 8ff3551edc..defaf3f395 100644
--- a/activesupport/lib/active_support/json/encoding.rb
+++ b/activesupport/lib/active_support/json/encoding.rb
@@ -85,7 +85,7 @@ module ActiveSupport
when String
EscapedString.new(value)
when Numeric, NilClass, TrueClass, FalseClass
- value
+ value.as_json
when Hash
Hash[value.map { |k, v| [jsonify(k), jsonify(v)] }]
when Array