From 5ec23b95ba7d5a00d20f6ec59f75c34a2ac73b5d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 23 May 2011 14:02:33 -0700 Subject: fixing 1.8 support for new fixture tests --- activerecord/lib/active_record/fixtures/file.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/fixtures/file.rb b/activerecord/lib/active_record/fixtures/file.rb index da07cf5da1..04f494db2c 100644 --- a/activerecord/lib/active_record/fixtures/file.rb +++ b/activerecord/lib/active_record/fixtures/file.rb @@ -43,7 +43,10 @@ module ActiveRecord # Validate our unmarshalled data. def validate(data) - raise Fixture::FormatError, 'fixture is not a hash' unless Hash === data + unless Hash === data || YAML::Omap === data + raise Fixture::FormatError, 'fixture is not a hash' + end + raise Fixture::FormatError unless data.all? { |name, row| Hash === row } data end -- cgit v1.2.3