aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-06-10 11:50:37 +0200
committerYves Senn <yves.senn@gmail.com>2014-06-26 22:03:48 +0200
commit1c170fdea2be04691c7daa8266084766fe963fff (patch)
treeb0735d6f12d2f8b744f9eb6cac664c388a9d4d50 /activerecord/test/cases/migration
parent74b2fe4c0febe051cb48c7c25a565333ddf22bce (diff)
downloadrails-1c170fdea2be04691c7daa8266084766fe963fff.tar.gz
rails-1c170fdea2be04691c7daa8266084766fe963fff.tar.bz2
rails-1c170fdea2be04691c7daa8266084766fe963fff.zip
fk: generalize using `AlterTable` and `SchemaCreation`.
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r--activerecord/test/cases/migration/foreign_key_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/migration/foreign_key_test.rb b/activerecord/test/cases/migration/foreign_key_test.rb
index 655393445d..6ad595668f 100644
--- a/activerecord/test/cases/migration/foreign_key_test.rb
+++ b/activerecord/test/cases/migration/foreign_key_test.rb
@@ -23,8 +23,10 @@ module ActiveRecord
end
teardown do
- @connection.execute "DROP TABLE IF EXISTS astronauts"
- @connection.execute "DROP TABLE IF EXISTS rockets"
+ if defined?(@connection)
+ @connection.execute "DROP TABLE IF EXISTS astronauts"
+ @connection.execute "DROP TABLE IF EXISTS rockets"
+ end
end
def test_foreign_keys