aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAlexey Muranov <muranov@math.univ-toulouse.fr>2011-12-27 01:48:06 +0100
committerAlexey Muranov <muranov@math.univ-toulouse.fr>2011-12-28 11:58:07 +0100
commit64f106dfd1bcff13882ef2be44585f68c6cb9950 (patch)
tree135875688825f6440c6cebb5f648aa4f4b6e5e20 /activerecord
parentae8bb118427780828134cfaf92a9515e9a5c1671 (diff)
downloadrails-64f106dfd1bcff13882ef2be44585f68c6cb9950.tar.gz
rails-64f106dfd1bcff13882ef2be44585f68c6cb9950.tar.bz2
rails-64f106dfd1bcff13882ef2be44585f68c6cb9950.zip
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.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/fixtures.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 65c7f3afbb..deffc7cec5 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -486,8 +486,8 @@ module ActiveRecord
# 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