Permalink
Browse files

Use the correct table name from fixture

Fixed a bug in fixtures.rb where the table name was incorrectly inferred from the fixture path which was ambiguously called "table_name" but was also used as the fixture name.
Now, the "correct" table name is taken from an instance variable.
  • Loading branch information...
1 parent ae8bb11 commit 64f106dfd1bcff13882ef2be44585f68c6cb9950 Alexey Muranov committed Dec 27, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/fixtures.rb
@@ -486,8 +486,8 @@ def self.create_fixtures(fixtures_directory, table_names, class_names = {})
# Cap primary key sequences to max(pk).
if connection.respond_to?(:reset_pk_sequence!)
- table_names.each do |table_name|
- connection.reset_pk_sequence!(table_name.tr('/', '_'))
+ fixture_files.each do |ff|
+ connection.reset_pk_sequence!(ff.table_name)
end
end
end

0 comments on commit 64f106d

Please sign in to comment.