diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2011-12-09 03:15:59 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2011-12-09 03:33:06 +0100 |
commit | 1d9de9d7585f2c753b629080b1239969aaf8499a (patch) | |
tree | 7a74cdca5cf071eb589640a4d3dddfbe9bf06eb6 /activerecord/test/cases | |
parent | b164ab75d65fa0c8a93c287835091bc704c226f1 (diff) | |
download | rails-1d9de9d7585f2c753b629080b1239969aaf8499a.tar.gz rails-1d9de9d7585f2c753b629080b1239969aaf8499a.tar.bz2 rails-1d9de9d7585f2c753b629080b1239969aaf8499a.zip |
Run also migrations in subdirectories.
With this commit, ActiveRecord will also look for migrations
in db/migrate subdirectories.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 7c92db5def..fb49dccbd3 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1346,6 +1346,15 @@ if ActiveRecord::Base.connection.supports_migrations? end end + def test_finds_migrations_in_subdirectories + migrations = ActiveRecord::Migrator.new(:up, MIGRATIONS_ROOT + "/valid_with_subdirectories").migrations + + [[1, 'ValidPeopleHaveLastNames'], [2, 'WeNeedReminders'], [3, 'InnocentJointable']].each_with_index do |pair, i| + assert_equal migrations[i].version, pair.first + assert_equal migrations[i].name, pair.last + end + end + def test_finds_migrations_from_two_directories directories = [MIGRATIONS_ROOT + '/valid_with_timestamps', MIGRATIONS_ROOT + '/to_copy_with_timestamps'] migrations = ActiveRecord::Migrator.new(:up, directories).migrations |