Module: Refinery::Blog::Comment::Moderation

Defined in:
app/models/refinery/blog/comment.rb

Class Method Summary collapse

Class Method Details

.enabled?Boolean


67
68
69
70
71
72
# File 'app/models/refinery/blog/comment.rb', line 67

def enabled?
  Refinery::Setting.find_or_set(:comment_moderation, true, {
    scoping: 'blog',
    restricted: false
  })
end

.toggle!Object


74
75
76
77
78
79
80
81
# File 'app/models/refinery/blog/comment.rb', line 74

def toggle!
  new_value = {
    value: !Blog::Comment::Moderation.enabled?,
    scoping: 'blog',
    restricted: false
  }
  Refinery::Setting.set(:comment_moderation, new_value)
end