From fd44f9f28acc508d54f5769308f281e3f7bd5802 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 18 Jul 2022 20:21:24 +0700 Subject: [PATCH] chore: add file size to response (#5054) Add file_size to the attachment response to display the file size in chat. Fixes: #4992 --- app/models/attachment.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 2a8e575f3..4fa1b7e57 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -68,7 +68,8 @@ class Attachment < ApplicationRecord { extension: extension, data_url: file_url, - thumb_url: thumb_url + thumb_url: thumb_url, + file_size: file.byte_size } end