diff --git a/app/models/post_appeal.rb b/app/models/post_appeal.rb index c799bc9a8..d758f945f 100644 --- a/app/models/post_appeal.rb +++ b/app/models/post_appeal.rb @@ -6,6 +6,7 @@ class PostAppeal < ApplicationRecord belongs_to :creator, :class_name => "User" belongs_to :post validates_presence_of :reason + validates :reason, presence: true, length: { in: 1..140 } validate :validate_post_is_inactive validate :validate_creator_is_not_limited validates_uniqueness_of :creator_id, :scope => :post_id, :message => "have already appealed this post" diff --git a/app/models/post_flag.rb b/app/models/post_flag.rb index 54d6f445f..f87f512c4 100644 --- a/app/models/post_flag.rb +++ b/app/models/post_flag.rb @@ -10,7 +10,7 @@ class PostFlag < ApplicationRecord belongs_to :creator, class_name: "User" belongs_to :post - validates_presence_of :reason + validates :reason, presence: true, length: { in: 1..140 } validate :validate_creator_is_not_limited, on: :create validate :validate_post validates_uniqueness_of :creator_id, :scope => :post_id, :on => :create, :unless => :is_deletion, :message => "have already flagged this post"