diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 17:20:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-29 17:20:56 -0700 |
commit | 651836a4bd217d7d9992f4d9b34fa855aa7c0229 (patch) | |
tree | 6769b4d03682f54f35288e088a30079521816942 | |
parent | 9971387a3b4ca0c03b9bd32de7dc417c5399fdd7 (diff) | |
download | rails-651836a4bd217d7d9992f4d9b34fa855aa7c0229.tar.gz rails-651836a4bd217d7d9992f4d9b34fa855aa7c0229.tar.bz2 rails-651836a4bd217d7d9992f4d9b34fa855aa7c0229.zip |
table name needs to be classified when instantiating fixtures
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 0939ec2626..96fea741e0 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -509,7 +509,9 @@ class Fixtures # FIXME: Apparently JK uses this. connection = block_given? ? yield : ActiveRecord::Base.connection - files_to_read = table_names.reject { |table_name| fixture_is_cached?(connection, table_name) } + files_to_read = table_names.reject { |table_name| + fixture_is_cached?(connection, table_name) + } unless files_to_read.empty? connection.disable_referential_integrity do @@ -521,7 +523,7 @@ class Fixtures fixtures_map[path] = Fixtures.new( connection, table_name, - class_names[table_name.to_sym], + class_names[table_name.to_sym] || table_name.classify, File.join(fixtures_directory, path)) end |