akismet integration

This commit is contained in:
r888888888
2017-09-14 13:19:16 -07:00
parent d12f082f9a
commit b944b642b8
14 changed files with 90 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
class DmailsController < ApplicationController
respond_to :html, :xml, :json
before_filter :member_only, except: [:index, :show, :destroy, :mark_all_as_read]
before_filter :gold_only, only: [:ham, :spam]
def new
if params[:respond_to_id]
@@ -55,6 +56,18 @@ class DmailsController < ApplicationController
CurrentUser.user.save
end
def spam
@dmail = Dmail.find(params[:id])
@dmail.update_column(:is_spam, true)
@dmail.spam!
end
def ham
@dmail = Dmail.find(params[:id])
@dmail.update_column(:is_spam, false)
@dmail.ham!
end
private
def check_privilege(dmail)