Permalink
Browse files

db:migrate:status refactoring: Rewrite hand-crafted SQL query with Ac…

…tiveRecord#pluck
  • Loading branch information...
1 parent c4918ee commit e75bdcb4d8698947ed228eeacd2d3f23eaad0f6b @DNNX DNNX committed Jun 26, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/railties/databases.rake
View
2 activerecord/lib/active_record/railties/databases.rake
@@ -96,7 +96,7 @@ db_namespace = namespace :db do
unless ActiveRecord::Base.connection.table_exists?(ActiveRecord::Migrator.schema_migrations_table_name)
abort 'Schema migrations table does not exist yet.'
end
- db_list = ActiveRecord::Base.connection.select_values("SELECT version FROM #{ActiveRecord::Migrator.schema_migrations_table_name}")
+ db_list = ActiveRecord::SchemaMigration.pluck(:version)
db_list.map! { |version| ActiveRecord::SchemaMigration.normalize_migration_number(version) }
file_list =

0 comments on commit e75bdcb

Please sign in to comment.