Merge branch 'activefx-rails-5-1-schema-migration-table-name-fix'

This commit is contained in:
Ernesto Tagwerker 2017-03-21 09:29:43 -04:00
commit 8d6ba07de8
2 changed files with 3 additions and 3 deletions

View file

@ -192,7 +192,7 @@ module DatabaseCleaner
FROM pg_tables
WHERE
tablename !~ '_prt_' AND
tablename <> '#{::ActiveRecord::Migrator.schema_migrations_table_name}' AND
tablename <> '#{::ActiveRecord::SchemaMigration.table_name}' AND
schemaname = ANY (current_schemas(false))
_SQL
rows.collect { |result| result.first }
@ -257,7 +257,7 @@ module DatabaseCleaner::ActiveRecord
# overwritten
def migration_storage_names
[::ActiveRecord::Migrator.schema_migrations_table_name]
[::ActiveRecord::SchemaMigration.table_name]
end
def cache_tables?

View file

@ -40,7 +40,7 @@ module DatabaseCleaner
Truncation.new.clean
end
it "should use ActiveRecord's schema_migrations_table_name" do
it "should use ActiveRecord's SchemaMigration.table_name" do
connection.stub(:database_cleaner_table_cache).and_return(%w[pre_schema_migrations_suf widgets dogs])
::ActiveRecord::Base.stub(:table_name_prefix).and_return('pre_')
::ActiveRecord::Base.stub(:table_name_suffix).and_return('_suf')