diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-11 17:05:16 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-11 17:06:21 -0700 |
commit | 4bcacc80667a548664b5ca09d85074c6c383748e (patch) | |
tree | f3af2b2142eb31834120912984547ef5728e6b92 /activerecord | |
parent | 95fdaf965a89e14840bfce79ed8aa6f4a9db08d8 (diff) | |
download | rails-4bcacc80667a548664b5ca09d85074c6c383748e.tar.gz rails-4bcacc80667a548664b5ca09d85074c6c383748e.tar.bz2 rails-4bcacc80667a548664b5ca09d85074c6c383748e.zip |
Merge pull request #2936 from joelmoss/migration_status
db:migrate:status not looking at all migration paths
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 13c41350fb..b3316fd1a2 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -203,11 +203,13 @@ db_namespace = namespace :db do end db_list = ActiveRecord::Base.connection.select_values("SELECT version FROM #{ActiveRecord::Migrator.schema_migrations_table_name}") file_list = [] - Dir.foreach(File.join(Rails.root, 'db', 'migrate')) do |file| - # only files matching "20091231235959_some_name.rb" pattern - if match_data = /^(\d{14})_(.+)\.rb$/.match(file) - status = db_list.delete(match_data[1]) ? 'up' : 'down' - file_list << [status, match_data[1], match_data[2].humanize] + ActiveRecord::Migrator.migrations_paths.each do |path| + Dir.foreach(path) do |file| + # only files matching "20091231235959_some_name.rb" pattern + if match_data = /^(\d{14})_(.+)\.rb$/.match(file) + status = db_list.delete(match_data[1]) ? 'up' : 'down' + file_list << [status, match_data[1], match_data[2].humanize] + end end end db_list.map! do |version| |