aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-09-11 17:05:16 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-09-11 17:06:21 -0700
commit4bcacc80667a548664b5ca09d85074c6c383748e (patch)
treef3af2b2142eb31834120912984547ef5728e6b92 /activerecord
parent95fdaf965a89e14840bfce79ed8aa6f4a9db08d8 (diff)
downloadrails-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.rake12
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|