Skip to content

Commit

Permalink
Prefer JSON.encode(value) to value.to_json
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Jun 9, 2009
1 parent 14de1a9 commit 5b256ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activeresource/lib/active_resource/formats/json_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def mime_type
"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)
Expand Down

0 comments on commit 5b256ac

Please sign in to comment.