chore: attachment validation fix (#2976)

- Attachment validation was supposed to affect the web widget channel only. But it was validating for all channels
This commit is contained in:
Sojan Jose 2021-09-07 22:59:02 +05:30 committed by GitHub
parent 7245e66b31
commit 8de4ce0037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,7 +87,7 @@ class Attachment < ApplicationRecord
end end
def acceptable_file def acceptable_file
should_validate_file? return unless should_validate_file?
errors.add(:file, 'is too big') if file.byte_size > 40.megabytes errors.add(:file, 'is too big') if file.byte_size > 40.megabytes