diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-21 14:24:35 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-21 14:24:35 -0200 |
commit | d36a28ac59c8cedcda92ae5e9d84695caec66783 (patch) | |
tree | d8e47a44c64e18015c57d8b1dbf1e045f95fb912 | |
parent | 01c1667b977be4794fe0cf5f2d2b0289a32f4825 (diff) | |
parent | ed3c38c7aa2653ddba67ad12926ac158fbdf6c32 (diff) | |
download | rails-d36a28ac59c8cedcda92ae5e9d84695caec66783.tar.gz rails-d36a28ac59c8cedcda92ae5e9d84695caec66783.tar.bz2 rails-d36a28ac59c8cedcda92ae5e9d84695caec66783.zip |
Merge pull request #18628 from yahonda/if_exists_testings
Replace `if exists` with `table_exists?` and drop table with `drop_table`
-rw-r--r-- | activerecord/test/cases/migration/references_foreign_key_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/primary_keys_test.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/migration/references_foreign_key_test.rb b/activerecord/test/cases/migration/references_foreign_key_test.rb index bba8897a0d..99de7db70c 100644 --- a/activerecord/test/cases/migration/references_foreign_key_test.rb +++ b/activerecord/test/cases/migration/references_foreign_key_test.rb @@ -10,8 +10,8 @@ module ActiveRecord end teardown do - @connection.execute("drop table if exists testings") - @connection.execute("drop table if exists testing_parents") + @connection.drop_table("testings") if @connection.table_exists? "testings" + @connection.drop_table("testing_parents") if @connection.table_exists? "testing_parents" end test "foreign keys can be created with the table" do diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index 751eccc015..4b668f84dd 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -210,7 +210,7 @@ class PrimaryKeyAnyTypeTest < ActiveRecord::TestCase end teardown do - @connection.execute("DROP TABLE IF EXISTS barcodes") + @connection.drop_table(:barcodes) if @connection.table_exists? :barcodes end def test_any_type_primary_key |