aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/encoders
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-30 20:57:50 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-30 20:57:50 +0000
commit7275d2749cb829d89bffe7e6aa87c99084351f6a (patch)
treeea1ffa76f30699cb84827bf6d21dbdb6d1201c1e /activesupport/lib/active_support/json/encoders
parent66d05f5e2c7ac6b18220956fbcf34efcd32638fc (diff)
downloadrails-7275d2749cb829d89bffe7e6aa87c99084351f6a.tar.gz
rails-7275d2749cb829d89bffe7e6aa87c99084351f6a.tar.bz2
rails-7275d2749cb829d89bffe7e6aa87c99084351f6a.zip
Fixed JSON encoding to use quoted keys according to the JSON standard (closes #8762) [choonkat/chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7697 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/json/encoders')
-rw-r--r--activesupport/lib/active_support/json/encoders/hash.rb2
1 files changed, 0 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/json/encoders/hash.rb b/activesupport/lib/active_support/json/encoders/hash.rb
index 3654e10b2e..9a9f074847 100644
--- a/activesupport/lib/active_support/json/encoders/hash.rb
+++ b/activesupport/lib/active_support/json/encoders/hash.rb
@@ -2,8 +2,6 @@ class Hash
def to_json #:nodoc:
returning result = '{' do
result << map do |key, value|
- key = ActiveSupport::JSON::Variable.new(key.to_s) if
- ActiveSupport::JSON.can_unquote_identifier?(key)
"#{ActiveSupport::JSON.encode(key)}: #{ActiveSupport::JSON.encode(value)}"
end * ', '
result << '}'