From e75bdcb4d8698947ed228eeacd2d3f23eaad0f6b Mon Sep 17 00:00:00 2001 From: Viktar Basharymau Date: Thu, 26 Jun 2014 20:08:19 +0300 Subject: db:migrate:status refactoring: Rewrite hand-crafted SQL query with ActiveRecord#pluck --- activerecord/lib/active_record/railties/databases.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index fb890ed709..c82a56718a 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/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 = -- cgit v1.2.3