add mark all dmail as read option

This commit is contained in:
albert
2013-02-20 22:52:42 -05:00
parent 13ebfeacb6
commit 65b45e46c2
4 changed files with 9 additions and 0 deletions

View File

@@ -41,6 +41,12 @@ class DmailsController < ApplicationController
redirect_to dmails_path, :notice => "Message destroyed"
end
def mark_all_as_read
Dmail.visible.unread.each do |x|
x.update_column(:is_read, true)
end
end
private
def check_privilege(dmail)
if !dmail.visible_to?(CurrentUser.user)