Method: Sequel::SQLite::DatasetMethods#delete
- Defined in:
- lib/sequel/adapters/shared/sqlite.rb
permalink #delete(&block) ⇒ Object
SQLite performs a TRUNCATE style DELETE if no filter is specified. Since we want to always return the count of records, add a condition that is always true and then delete.
670 671 672 |
# File 'lib/sequel/adapters/shared/sqlite.rb', line 670 def delete(&block) @opts[:where] ? super : where(1=>1).delete(&block) end |