mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Merge branch 'activefx-rails-5-1-schema-migration-table-name-fix'
This commit is contained in:
commit
8d6ba07de8
2 changed files with 3 additions and 3 deletions
|
@ -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?
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue