diff options
author | kennyj <kennyj@gmail.com> | 2012-01-10 22:49:44 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-01-11 00:35:06 +0900 |
commit | c5ba4896ab4b5d5c8c3d5f3eaf970b600c7a2017 (patch) | |
tree | 0bf5373e5db0ec3c38a4f2e6a5c653c1612c2b50 /activerecord/test/cases | |
parent | 3f38d8442e2c365c6625c647d77f7b31f4da0cd1 (diff) | |
download | rails-c5ba4896ab4b5d5c8c3d5f3eaf970b600c7a2017.tar.gz rails-c5ba4896ab4b5d5c8c3d5f3eaf970b600c7a2017.tar.bz2 rails-c5ba4896ab4b5d5c8c3d5f3eaf970b600c7a2017.zip |
migrate(:down) method with table_name_prefix
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/invertible_migration_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/invertible_migration_test.rb b/activerecord/test/cases/invertible_migration_test.rb index 3ae7b63dff..8f1cdd47ea 100644 --- a/activerecord/test/cases/invertible_migration_test.rb +++ b/activerecord/test/cases/invertible_migration_test.rb @@ -88,5 +88,17 @@ module ActiveRecord LegacyMigration.down assert !ActiveRecord::Base.connection.table_exists?("horses"), "horses should not exist" end + + def test_migrate_down_with_table_name_prefix + ActiveRecord::Base.table_name_prefix = 'p_' + ActiveRecord::Base.table_name_suffix = '_s' + migration = InvertibleMigration.new + migration.migrate(:up) + assert_nothing_raised { migration.migrate(:down) } + assert !ActiveRecord::Base.connection.table_exists?("p_horses_s"), "p_horses_s should not exist" + ensure + ActiveRecord::Base.table_name_prefix = ActiveRecord::Base.table_name_suffix = '' + end + end end |