Permalink
Browse files

Ruby 1.9 compat: fix two failing tests since String#each has been rem…

…oved. Closes #10655.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8524 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ff47ba9 commit 4e04ec4adb4bae4e880a73a6f9ce1851d444b058 @jeremy jeremy committed Jan 2, 2008
Showing with 4 additions and 2 deletions.
  1. +1 −1 activerecord/CHANGELOG
  2. +3 −1 activerecord/lib/active_record/fixtures.rb
View
@@ -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)
@@ -704,7 +704,8 @@ def read_yaml_fixture_files
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 @@ def self.require_fixture_classes(table_names = nil)
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('.', '_')

0 comments on commit 4e04ec4

Please sign in to comment.