From f73e328709eb17cdf76abcd7d46f24144f903dc6 Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 27 Jun 2025 16:24:36 -0700 Subject: [PATCH] make it work --- app/models/attachment.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,