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

Changeset 9191

Show
Ignore:
Timestamp:
04/01/08 06:33:16 (7 months ago)
Author:
bitsweat
Message:

Ruby 1.9 compat: delete DEFAULTS key from Hash not Omap array

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/fixtures.rb

    r9093 r9191  
    562562 
    563563    # allow a standard key to be used for doing defaults in YAML 
    564     delete(assoc("DEFAULTS")) 
     564    if is_a?(Hash) 
     565      delete('DEFAULTS') 
     566    else 
     567      delete(assoc('DEFAULTS')) 
     568    end 
    565569 
    566570    # track any join tables we need to insert later 
  • trunk/activerecord/test/cases/fixtures_test.rb

    r9147 r9191  
    566566  end 
    567567 
    568   # FIXME: first assertion fails on Ruby 1.9 
    569568  def test_strips_DEFAULTS_key 
    570569    assert_raise(StandardError) { parrots(:DEFAULTS) }