module Avram::SoftDelete::Model

Overview

table do column soft_deleted_at : Time? end end


You should also add the `Avram::SoftDeleteQuery` to your query

```crystal
class ArticleQuery < Article::BaseQuery
  include Avram::SoftDelete::Query
end

Defined in:

avram/soft_delete/model.cr

Instance Method Summary

Instance Method Detail

def restore : self #

Restore the record

This will set #soft_deleted_at to nil


[View source]
abstract def save_operation_class #

[View source]
def soft_delete : self #

Soft delete the record

This will set #soft_deleted_at to the current time (Time.utc)


[View source]
def soft_deleted? : Bool #

Returns true if soft deleted, otherwise false

If the #soft_deleted_at has a time value the record is "soft deleted". If #soft_deleted_at is nil the record has not been deleted yet.


[View source]
abstract def soft_deleted_at : Time | Nil #

[View source]