diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-02 18:46:21 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-02 18:46:21 -0300 |
commit | 90387e3e6ddc87029ba1e862f87e4f27623bf360 (patch) | |
tree | e9b4170529e365feb4c1ffaefecba283bab48982 /activerecord/lib | |
parent | 07278519bb6db5579171fea70bccdfee1306f1d4 (diff) | |
parent | 29e7e430b735c5e2acaf1634c998ed1bd1651f23 (diff) | |
download | rails-90387e3e6ddc87029ba1e862f87e4f27623bf360.tar.gz rails-90387e3e6ddc87029ba1e862f87e4f27623bf360.tar.bz2 rails-90387e3e6ddc87029ba1e862f87e4f27623bf360.zip |
Merge pull request #19177 from gregmolnar/fixtures
Added testcase for #18742
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 75b0e1e08d..18775caad2 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -539,12 +539,10 @@ module ActiveRecord conn.insert_fixture(row, fixture_set_name) end end - end - # Cap primary key sequences to max(pk). - if connection.respond_to?(:reset_pk_sequence!) - fixture_sets.each do |fs| - connection.reset_pk_sequence!(fs.table_name) + # Cap primary key sequences to max(pk). + if conn.respond_to?(:reset_pk_sequence!) + conn.reset_pk_sequence!(fs.table_name) end end end |