mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 07:32:02 +01:00
Validate presence of text even for remote statuses
This commit is contained in:
parent
7b7bf834e9
commit
882de42bab
1 changed files with 1 additions and 0 deletions
|
@ -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') }
|
||||
|
|
Loading…
Reference in a new issue