diff --git a/app/models/attachment.rb b/app/models/attachment.rb index fd114c38c..4c35839d9 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -34,9 +34,11 @@ class Attachment < ApplicationRecord application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.openxmlformats-officedocument.wordprocessingml.document ].freeze + + has_one_attached :file belongs_to :account belongs_to :message - has_one_attached :file + validate :acceptable_file validates :external_url, length: { maximum: Limits::URL_LENGTH_LIMIT } enum file_type: { :image => 0, :audio => 1, :video => 2, :file => 3, :location => 4, :fallback => 5, :share => 6, :story_mention => 7,