diff options
author | Dylan Thacker-Smith <Dylan.Smith@shopify.com> | 2013-12-17 16:02:52 -0500 |
---|---|---|
committer | Dylan Thacker-Smith <Dylan.Smith@shopify.com> | 2014-01-06 10:46:35 -0500 |
commit | 06ace1e2b5cdccf67ff969ff0d355fd87f46dcf0 (patch) | |
tree | aa5eaa81b94577e3d2fd5aed435c29c642bba748 /activerecord/test | |
parent | f2b80a41b5c163b32dfdd0fa797466543c6ec0e9 (diff) | |
download | rails-06ace1e2b5cdccf67ff969ff0d355fd87f46dcf0.tar.gz rails-06ace1e2b5cdccf67ff969ff0d355fd87f46dcf0.tar.bz2 rails-06ace1e2b5cdccf67ff969ff0d355fd87f46dcf0.zip |
activerecord: Initialize Migration with version from MigrationProxy.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/migrations/version_check/20131219224947_migration_version_check.rb | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index ebcc778b8b..0363bf1048 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -79,6 +79,10 @@ class MigrationTest < ActiveRecord::TestCase ActiveRecord::Migrator.migrations_paths = old_path end + def test_migration_version + ActiveRecord::Migrator.run(:up, MIGRATIONS_ROOT + "/version_check", 20131219224947) + end + def test_create_table_with_force_true_does_not_drop_nonexisting_table if Person.connection.table_exists?(:testings2) Person.connection.drop_table :testings2 diff --git a/activerecord/test/migrations/version_check/20131219224947_migration_version_check.rb b/activerecord/test/migrations/version_check/20131219224947_migration_version_check.rb new file mode 100644 index 0000000000..9d46485a31 --- /dev/null +++ b/activerecord/test/migrations/version_check/20131219224947_migration_version_check.rb @@ -0,0 +1,8 @@ +class MigrationVersionCheck < ActiveRecord::Migration + def self.up + raise "incorrect migration version" unless version == 20131219224947 + end + + def self.down + end +end |