Files
danbooru/app/policies/post_appeal_policy.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

20 lines
322 B
Ruby

# frozen_string_literal: true
class PostAppealPolicy < ApplicationPolicy
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