Fix media attachments without file being uploadable (#12562)
Fix #12554
This commit is contained in:
parent
43daeccccb
commit
81cc86bb1f
4 changed files with 19 additions and 21 deletions
|
@ -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) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue