From 8d767b477fb2a1c2cbc362c1e4b50d8c3e73c61d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 18 Nov 2016 23:14:41 +0100 Subject: [PATCH] Validate presence of text even for remote statuses --- app/models/status.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/status.rb b/app/models/status.rb index 56f52975df..a5c3e19ba7 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -19,6 +19,7 @@ class Status < ApplicationRecord validates :account, presence: true validates :uri, uniqueness: true, unless: 'local?' validates :text, presence: true, length: { maximum: 500 }, if: proc { |s| s.local? && !s.reblog? } + validates :text, presence: true, if: proc { |s| !s.local? && !s.reblog? } validates :reblog, uniqueness: { scope: :account, message: 'of status already exists' }, if: 'reblog?' default_scope { order('id desc') }