mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
simplify Strategy base class.
This commit is contained in:
parent
f536f174f8
commit
511fffcb89
1 changed files with 0 additions and 14 deletions
|
@ -32,19 +32,5 @@ module DatabaseCleaner
|
||||||
clean
|
clean
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
# Optional helper method for use in strategies with :only and :except options
|
|
||||||
def tables_to_clean all_tables, only: [], except: []
|
|
||||||
if only.any?
|
|
||||||
if except.any?
|
|
||||||
raise ArgumentError, "You may only specify either :only or :except. Doing both doesn't really make sense does it?"
|
|
||||||
end
|
|
||||||
only
|
|
||||||
else
|
|
||||||
all_tables - except
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue