Skip to content

Commit

Permalink
Merge pull request #77 from Connorhd/patch-1
Browse files Browse the repository at this point in the history
Add a WHERE clause to delete statement
  • Loading branch information
etagwerker authored Feb 17, 2023
2 parents 0e090e9 + 3084fa5 commit 0617758
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/database_cleaner/active_record/deletion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def delete_tables(connection, table_names)
end

def delete_table connection, table_name
connection.execute("DELETE FROM #{connection.quote_table_name(table_name)}")
connection.execute("DELETE FROM #{connection.quote_table_name(table_name)} WHERE 1=1")
end

def tables_to_truncate(connection)
Expand Down

0 comments on commit 0617758

Please sign in to comment.