appeals: make appeal reasons optional.

This commit is contained in:
evazion
2020-08-16 10:33:12 -05:00
parent a1be6d35d1
commit d4d1088c30
2 changed files with 2 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ class PostAppeal < ApplicationRecord
belongs_to :creator, :class_name => "User"
belongs_to :post
validates :reason, presence: true, length: { in: 1..140 }
validates :reason, length: { maximum: 140 }
validate :validate_post_is_appealable, on: :create
validate :validate_creator_is_not_limited, on: :create
validates :creator, uniqueness: { scope: :post, message: "have already appealed this post" }, on: :create