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

View File

@@ -3,7 +3,6 @@
<%= edit_form_for(post_appeal, format: :js, remote: true) do |f| %>
<%= f.hidden_field :post_id %>
<%= f.input :reason, as: :dtext, inline: true %>
<%= dtext_preview_button "post_appeal_reason" %>
<%= f.input :reason, as: :dtext, inline: true, placeholder: "Optional" %>
<% end %>
</div>