Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Patch for the pg truncation adapter to prevent an emtpy list of table…

…s from

generating an illegal TRUCATE TABLE statement.
  • Loading branch information...
commit 1f3a68fbbae452ec50831445846e557e7411d47d 1 parent fd3dc63
Michael-Keith Bernard authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/database_cleaner/active_record/truncation.rb
View
1  lib/database_cleaner/active_record/truncation.rb
@@ -96,6 +96,7 @@ def truncate_table(table_name)
end
def truncate_tables(table_names)
+ return if table_names.nil? || table_names.empty?
execute("TRUNCATE TABLE #{table_names.map{|name| quote_table_name(name)}.join(', ')} #{restart_identity} #{cascade};")
end
Please sign in to comment.
Something went wrong with that request. Please try again.