diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2017-03-06 12:09:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-06 12:09:23 +0000 |
commit | 003bd6ebe2ba8644a0b331a9b5de8bfc1847b854 (patch) | |
tree | ff2e7f4e0ed92e9c79e74e5f98bb57ba605c07be /activerecord/lib/active_record/connection_adapters | |
parent | 0b5c7e354291bdf674fa8777b6443b224924bad4 (diff) | |
parent | 2803c0382fe60423b5c17c1be37abaf1cc408819 (diff) | |
download | rails-003bd6ebe2ba8644a0b331a9b5de8bfc1847b854.tar.gz rails-003bd6ebe2ba8644a0b331a9b5de8bfc1847b854.tar.bz2 rails-003bd6ebe2ba8644a0b331a9b5de8bfc1847b854.zip |
Merge pull request #28305 from kamipo/extract_schema_migration_all_versions
Extract `SchemaMigration.all_versions`
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index cbb93e0ffe..a497a354f7 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -991,7 +991,7 @@ module ActiveRecord end def dump_schema_information #:nodoc: - versions = ActiveRecord::SchemaMigration.order("version").pluck(:version) + versions = ActiveRecord::SchemaMigration.all_versions insert_versions_sql(versions) end @@ -1027,7 +1027,7 @@ module ActiveRecord version = version.to_i sm_table = quote_table_name(ActiveRecord::SchemaMigration.table_name) - migrated = select_values("SELECT version FROM #{sm_table}").map(&:to_i) + migrated = ActiveRecord::SchemaMigration.all_versions.map(&:to_i) versions = ActiveRecord::Migrator.migration_files(migrations_paths).map do |file| ActiveRecord::Migrator.parse_migration_filename(file).first.to_i end |