Module: WithSoftDeletion

Extended by:
ActiveSupport::Concern
Included in:
Message
Defined in:
app/models/concerns/with_soft_deletion.rb

Instance Method Summary collapse

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/concerns/with_soft_deletion.rb', line 13

def deleted?
  deleted_at.present?
end

#soft_delete!(motive, deleter) ⇒ Object



9
10
11
# File 'app/models/concerns/with_soft_deletion.rb', line 9

def soft_delete!(motive, deleter)
  update! deletion_motive: motive, deleted_by: deleter, deleted_at: Time.current
end