Skip to content

Commit 0617758

Browse files
authored
Merge pull request #77 from Connorhd/patch-1
Add a WHERE clause to delete statement
2 parents 0e090e9 + 3084fa5 commit 0617758

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/database_cleaner/active_record/deletion.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def delete_tables(connection, table_names)
2323
end
2424

2525
def delete_table connection, table_name
26-
connection.execute("DELETE FROM #{connection.quote_table_name(table_name)}")
26+
connection.execute("DELETE FROM #{connection.quote_table_name(table_name)} WHERE 1=1")
2727
end
2828

2929
def tables_to_truncate(connection)

0 commit comments

Comments
 (0)