Make comment moderation toggleable
This commit is contained in:
parent
69026512c9
commit
97accf9489
2 changed files with 19 additions and 1 deletions
|
@ -6,4 +6,21 @@ class BlogComment < ActiveRecord::Base
|
|||
|
||||
named_scope :approved, :conditions => {:approved => true}
|
||||
named_scope :rejected, :conditions => {:approved => false}
|
||||
|
||||
module Moderation
|
||||
class << self
|
||||
def enabled?
|
||||
RefinerySetting.find_or_set(:comment_moderation, {
|
||||
:value => true,
|
||||
:scoping => :blog
|
||||
})
|
||||
end
|
||||
|
||||
def toggle
|
||||
currently = self.enabled?
|
||||
RefinerySetting[:comment_moderation] = !currently
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue