diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-05 20:28:03 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-03-05 20:28:03 +0900 |
commit | 60440a68b13a5408cd9c492cc2eaed2e68f95bd7 (patch) | |
tree | c12f4de2ef8543e0c4beda06fc4f74f6f016b7d3 /activerecord/lib | |
parent | 12038f6505cdbcdbea861c7ae5f272e918100e13 (diff) | |
download | rails-60440a68b13a5408cd9c492cc2eaed2e68f95bd7.tar.gz rails-60440a68b13a5408cd9c492cc2eaed2e68f95bd7.tar.bz2 rails-60440a68b13a5408cd9c492cc2eaed2e68f95bd7.zip |
Remove useless `Migrator.schema_migrations_table_name`
Simply use `SchemaMigration.table_name` instead.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 6 |
2 files changed, 3 insertions, 7 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 c9dd915e98..cbb93e0ffe 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -996,7 +996,7 @@ module ActiveRecord end def insert_versions_sql(versions) # :nodoc: - sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name) + sm_table = quote_table_name(ActiveRecord::SchemaMigration.table_name) if versions.is_a?(Array) sql = "INSERT INTO #{sm_table} (version) VALUES\n" @@ -1025,7 +1025,7 @@ module ActiveRecord def assume_migrated_upto_version(version, migrations_paths) migrations_paths = Array(migrations_paths) version = version.to_i - sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name) + sm_table = quote_table_name(ActiveRecord::SchemaMigration.table_name) migrated = select_values("SELECT version FROM #{sm_table}").map(&:to_i) versions = ActiveRecord::Migrator.migration_files(migrations_paths).map do |file| diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index c47e32df59..d8cf784933 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -1022,12 +1022,8 @@ module ActiveRecord new(:up, migrations(migrations_paths), nil) end - def schema_migrations_table_name - SchemaMigration.table_name - end - def get_all_versions(connection = Base.connection) - if connection.table_exists?(schema_migrations_table_name) + if SchemaMigration.table_exists? SchemaMigration.all.map { |x| x.version.to_i }.sort else [] |