make appeals editable
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user