aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-04-01 06:33:16 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-04-01 06:33:16 +0000
commitc3df9bfad2b7e560fcf8c5fb4b5ddc086d83a634 (patch)
tree65099a065f3d263aaa01e3a86b04e65ad7f975a2 /activerecord/lib
parentecdddc4de592be7080bcac983328464278835ed6 (diff)
downloadrails-c3df9bfad2b7e560fcf8c5fb4b5ddc086d83a634.tar.gz
rails-c3df9bfad2b7e560fcf8c5fb4b5ddc086d83a634.tar.bz2
rails-c3df9bfad2b7e560fcf8c5fb4b5ddc086d83a634.zip
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
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/fixtures.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 8847865451..f5b2e73da9 100755
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -561,7 +561,11 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash)
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|