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