提交 c3df9bfa 编写于 作者: J Jeremy Kemper

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


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9191 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 ecdddc4d
......@@ -561,7 +561,11 @@ def insert_fixtures
now = now.to_s(:db)
# allow a standard key to be used for doing defaults in YAML
delete(assoc("DEFAULTS"))
if is_a?(Hash)
delete('DEFAULTS')
else
delete(assoc('DEFAULTS'))
end
# track any join tables we need to insert later
habtm_fixtures = Hash.new do |h, habtm|
......
......@@ -565,7 +565,6 @@ def test_supports_yaml_arrays
assert(parrots(:louis).treasures.include?(treasures(:sapphire)))
end
# FIXME: first assertion fails on Ruby 1.9
def test_strips_DEFAULTS_key
assert_raise(StandardError) { parrots(:DEFAULTS) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册