diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index b56a272b24..6306601cff 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -6,7 +6,7 @@ * SQLite: fix rename_ and remove_column for columns with unique indexes. #10576 [Brandon Keepers] -* Ruby 1.9 compatibility. [Jeremy Kemper] +* Ruby 1.9 compatibility. #10655 [Jeremy Kemper, Dirkjan Bussink] *2.0.2* (December 16th, 2007) diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 611365669d..ffbce97295 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -704,7 +704,8 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) end yaml_value.each do |fixture| - fixture.each do |name, data| + raise Fixture::FormatError, "Bad data for #{@class_name} fixture named #{fixture}" unless fixture.respond_to?(:each) + fixture.each do |name, data| unless data raise Fixture::FormatError, "Bad data for #{@class_name} fixture named #{name} (nil)" end @@ -877,6 +878,7 @@ module Test #:nodoc: end def self.setup_fixture_accessors(table_names = nil) + table_names = [table_names] if table_names && !table_names.respond_to?(:each) (table_names || fixture_table_names).each do |table_name| table_name = table_name.to_s.tr('.', '_') |