Fix issue when deleting unread dmail
This commit is contained in:
@@ -44,6 +44,7 @@ class DmailsController < ApplicationController
|
|||||||
def destroy
|
def destroy
|
||||||
@dmail = Dmail.find(params[:id])
|
@dmail = Dmail.find(params[:id])
|
||||||
check_privilege(@dmail)
|
check_privilege(@dmail)
|
||||||
|
@dmail.mark_as_read!
|
||||||
@dmail.destroy
|
@dmail.destroy
|
||||||
redirect_to dmails_path, :notice => "Message destroyed"
|
redirect_to dmails_path, :notice => "Message destroyed"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user