Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5522

Show
Ignore:
Timestamp:
11/14/06 09:23:17 (3 years ago)
Author:
bitsweat
Message:

Merge [5521] from trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1-2-pre-release/activesupport/CHANGELOG

    r5498 r5522  
    11*SVN* 
     2 
     3* Hash#to_xml handles keys with the same name as Kernel methods.  #6613 [Catfish] 
    24 
    35* 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  
    3636          root = dasherize ? options[:root].to_s.dasherize : options[:root].to_s 
    3737 
    38           options[:builder].__send__(root) do 
     38          options[:builder].__send__(:method_missing, root) do 
    3939            each do |key, value| 
    4040              case value 
  • branches/1-2-pre-release/activesupport/test/core_ext/hash_ext_test.rb

    r5209 r5522  
    459459    assert_equal 3, hash_wia.default 
    460460  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 
    461472end