make appeals editable

This commit is contained in:
Lily
2021-06-29 14:34:08 -03:00
parent 4b6e706e5e
commit 8d49d35ab1
4 changed files with 45 additions and 1 deletions

View File

@@ -1,5 +1,17 @@
class PostAppealPolicy < ApplicationPolicy
def permitted_attributes
def edit?
update?
end
def update?
unbanned? && record.pending? && record.creator_id == user.id
end
def permitted_attributes_for_create
[:post_id, :reason]
end
def permitted_attributes_for_update
[:reason]
end
end