date, datetime
, or timestamp
) on a table and name it deletedAt
, Wheels will automagically start using it to record soft deletes.delete()
call on an object will delete the record from the table using a DELETE
statement. With the soft delete in place, an UPDATE
statement is sent instead (that sets the deletedAt
field to the current time).findAll()
function, for example, it will not return any record that has a value set in the deletedAt
field.includeSoftDeletes=true
to any findAll
type call.deletedAt IS NULL
to the WHERE
part of your SQL statements instead.