about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-01-23 21:40:03 +0100
committerGitHub <noreply@github.com>2020-01-23 21:40:03 +0100
commit81cc86bb1ffb662843938379eeb522e3a6f11b79 (patch)
tree8fb79407b7318731ad9e240383593ed3a45d9149 /app
parent43daeccccb31a0145c48f41c4ba449f0a3967ef2 (diff)
Fix media attachments without file being uploadable (#12562)
Fix #12554
Diffstat (limited to 'app')
-rw-r--r--app/models/media_attachment.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb
index 1fd0adfd0..42364641f 100644
--- a/app/models/media_attachment.rb
+++ b/app/models/media_attachment.rb
@@ -142,6 +142,7 @@ class MediaAttachment < ApplicationRecord
 
   validates :account, presence: true
   validates :description, length: { maximum: MAX_DESCRIPTION_LENGTH }, if: :local?
+  validates :file, presence: true, if: :local?
 
   scope :attached,   -> { where.not(status_id: nil).or(where.not(scheduled_status_id: nil)) }
   scope :unattached, -> { where(status_id: nil, scheduled_status_id: nil) }