From 8de4ce003701cc788d4d910a62ab1703580ac000 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Tue, 7 Sep 2021 22:59:02 +0530 Subject: [PATCH] chore: attachment validation fix (#2976) - Attachment validation was supposed to affect the web widget channel only. But it was validating for all channels --- app/models/attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index cb1f21e33..64637163d 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -87,7 +87,7 @@ class Attachment < ApplicationRecord end def acceptable_file - should_validate_file? + return unless should_validate_file? errors.add(:file, 'is too big') if file.byte_size > 40.megabytes