aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-06-08 19:30:27 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-06-08 19:37:52 -0700
commit5b256ac36922b4dfa4ab7aa639757c4817d06680 (patch)
treeee76f5cd6cb41fa347142862cf135c96dae88ba8 /activeresource
parent14de1a9597b35df43aeb03ad91aadb098b1a4d01 (diff)
downloadrails-5b256ac36922b4dfa4ab7aa639757c4817d06680.tar.gz
rails-5b256ac36922b4dfa4ab7aa639757c4817d06680.tar.bz2
rails-5b256ac36922b4dfa4ab7aa639757c4817d06680.zip
Prefer JSON.encode(value) to value.to_json
Diffstat (limited to 'activeresource')
-rw-r--r--activeresource/lib/active_resource/formats/json_format.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activeresource/lib/active_resource/formats/json_format.rb b/activeresource/lib/active_resource/formats/json_format.rb
index 101027d99e..9980634921 100644
--- a/activeresource/lib/active_resource/formats/json_format.rb
+++ b/activeresource/lib/active_resource/formats/json_format.rb
@@ -13,8 +13,8 @@ module ActiveResource
"application/json"
end
- def encode(hash, options={})
- hash.to_json(options)
+ def encode(hash, options = nil)
+ ActiveSupport::JSON.encode(hash, options)
end
def decode(json)