fix: External url validation in attachment (#7082)

fixes: https://linear.app/chatwoot/issue/CW-1746/activerecordrecordinvalid-validation-failed-external-url-is-too-long
This commit is contained in:
Sojan Jose
2023-05-15 20:33:58 +05:30
committed by GitHub
parent b994706265
commit ca85d4e1c6
2 changed files with 23 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ class Attachment < ApplicationRecord
belongs_to :message
has_one_attached :file
validate :acceptable_file
validates :external_url, length: { maximum: 1000 }
enum file_type: [:image, :audio, :video, :file, :location, :fallback, :share, :story_mention, :contact]
def push_event_data