Merge branch 'master' into attribute-searching
This commit is contained in:
@@ -12,7 +12,7 @@ class PostApproval < ApplicationRecord
|
||||
errors.add(:post, "is locked and cannot be approved")
|
||||
end
|
||||
|
||||
if post.status == "active"
|
||||
if post.is_active?
|
||||
errors.add(:post, "is already active and cannot be approved")
|
||||
end
|
||||
|
||||
@@ -28,7 +28,9 @@ class PostApproval < ApplicationRecord
|
||||
def approve_post
|
||||
is_undeletion = post.is_deleted
|
||||
|
||||
post.flags.each(&:resolve!)
|
||||
post.flags.pending.update!(status: :rejected)
|
||||
post.appeals.pending.update!(status: :succeeded)
|
||||
|
||||
post.update(approver: user, is_flagged: false, is_pending: false, is_deleted: false)
|
||||
ModAction.log("undeleted post ##{post_id}", :post_undelete) if is_undeletion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user