Skip to content

Commit 0b0bfc4

Browse files
[FIX] Typo for deletion and truncation strategy (#94)
1 parent 79b0876 commit 0b0bfc4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/database_cleaner/active_record/deletion.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ class Deletion < Truncation
77
def clean
88
connection.disable_referential_integrity do
99
if pre_count? && connection.respond_to?(:pre_count_tables)
10-
delete_tables(connection, connection.pre_count_tables(tables_to_truncate(connection)))
10+
delete_tables(connection, connection.pre_count_tables(tables_to_clean(connection)))
1111
else
12-
delete_tables(connection, tables_to_truncate(connection))
12+
delete_tables(connection, tables_to_clean(connection))
1313
end
1414
end
1515
end
@@ -40,7 +40,7 @@ def reset_id_sequence connection, table_name
4040
end
4141
end
4242

43-
def tables_to_truncate(connection)
43+
def tables_to_clean(connection)
4444
if information_schema_exists?(connection)
4545
@except += connection.database_cleaner_view_cache + migration_storage_names
4646
(@only.any? ? @only : tables_with_new_rows(connection)) - @except

lib/database_cleaner/active_record/truncation.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def initialize(opts={})
2020
def clean
2121
connection.disable_referential_integrity do
2222
if pre_count? && connection.respond_to?(:pre_count_truncate_tables)
23-
connection.pre_count_truncate_tables(tables_to_truncate(connection))
23+
connection.pre_count_truncate_tables(tables_to_clean(connection))
2424
else
25-
connection.truncate_tables(tables_to_truncate(connection))
25+
connection.truncate_tables(tables_to_clean(connection))
2626
end
2727
end
2828
end
@@ -39,7 +39,7 @@ def connection
3939
)
4040
end
4141

42-
def tables_to_truncate(connection)
42+
def tables_to_clean(connection)
4343
if @only.none?
4444
all_tables = cache_tables? ? connection.database_cleaner_table_cache : connection.database_tables
4545
@only = all_tables.map { |table| table.split(".").last }

0 commit comments

Comments
 (0)