Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit c3df9bfad2b7e560fcf8c5fb4b5ddc086d83a634 1 parent ecdddc4
Jeremy Kemper jeremy authored
6 activerecord/lib/active_record/fixtures.rb
View
@@ -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|
1  activerecord/test/cases/fixtures_test.rb
View
@@ -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) }
Please sign in to comment.
Something went wrong with that request. Please try again.