Changeset 5522
- Timestamp:
- 11/14/06 09:23:17 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1-2-pre-release/activesupport/CHANGELOG
r5498 r5522 1 1 *SVN* 2 3 * Hash#to_xml handles keys with the same name as Kernel methods. #6613 [Catfish] 2 4 3 5 * Don't quote hash keys in Hash#to_json if they're valid JavaScript identifiers. Disable this with ActiveSupport::JSON.unquote_hash_key_identifiers = false if you need strict JSON compliance. [Sam Stephenson] branches/1-2-pre-release/activesupport/lib/active_support/core_ext/hash/conversions.rb
r5209 r5522 36 36 root = dasherize ? options[:root].to_s.dasherize : options[:root].to_s 37 37 38 options[:builder].__send__( root) do38 options[:builder].__send__(:method_missing, root) do 39 39 each do |key, value| 40 40 case value branches/1-2-pre-release/activesupport/test/core_ext/hash_ext_test.rb
r5209 r5522 459 459 assert_equal 3, hash_wia.default 460 460 end 461 462 # The XML builder seems to fail miserably when trying to tag something 463 # with the same name as a Kernel method (throw, test, loop, select ...) 464 def test_kernel_method_names_to_xml 465 hash = { :throw => { :ball => 'red' } } 466 expected = '<person><throw><ball>red</ball></throw></person>' 467 468 assert_nothing_raised do 469 assert_equal expected, hash.to_xml(@xml_options) 470 end 471 end 461 472 end