dmails: replace hard deletions with soft deletions.

Turn deletions into soft deletions (set the is_deleted flag) instead of
hard deletions (remove from database). The is_deleted flag actually
already existed, but it was never used before.
This commit is contained in:
evazion
2020-01-30 21:49:55 -06:00
parent 5df8d08aae
commit f8db577c25
7 changed files with 26 additions and 24 deletions

View File

@@ -136,8 +136,6 @@ class Dmail < ApplicationRecord
q = q.text_attribute_matches(:title, params[:title_matches])
q = q.text_attribute_matches(:body, params[:message_matches], index_column: :message_index)
params[:is_spam] = false unless params[:is_spam].present?
q = q.read if params[:read].to_s.truthy?
q = q.unread if params[:read].to_s.falsy?