Class: Comment
Constant Summary
collapse
- STATUSES =
%w(pending_moderation published)
Instance Method Summary
collapse
#mark_as_spam!, #unmark_as_spam!
#depth, #parentable?, #parents
Instance Method Details
#publish! ⇒ Object
21
22
23
|
# File 'app/models/comment.rb', line 21
def publish!
update_attribute :status, :published
end
|
#published? ⇒ Boolean
17
18
19
|
# File 'app/models/comment.rb', line 17
def published?
status.to_s == 'published'
end
|
#unpublish! ⇒ Object
25
26
27
|
# File 'app/models/comment.rb', line 25
def unpublish!
update_attribute :status, :pending_moderation
end
|