From 3362df6009ee2b25deceed5726d147f14916508e Mon Sep 17 00:00:00 2001 From: Rodrigo Borba Date: Sun, 25 Jan 2026 11:54:25 -0300 Subject: [PATCH] =?UTF-8?q?Refatorar:=20remove=20verifica=C3=A7=C3=B5es=20?= =?UTF-8?q?redundantes=20de=20anexos=20na=20valida=C3=A7=C3=A3o=20de=20pre?= =?UTF-8?q?sen=C3=A7a=20de=20conte=C3=BAdo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/fix_null_message_crash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/fix_null_message_crash.rb b/config/initializers/fix_null_message_crash.rb index 5541602..af2799b 100644 --- a/config/initializers/fix_null_message_crash.rb +++ b/config/initializers/fix_null_message_crash.rb @@ -13,7 +13,7 @@ Rails.application.config.to_prepare do def ensure_content_presence_defensive # If content is present, or we have attachments, we are good. # We check .any? and .size to be robust against unsaved attachments in some contexts. - return if content.present? || attachments.any? || attachments.size > 0 || attachments.to_a.any? + return if content.present? || attachments.any? # Identifica a origem para um fallback mais inteligente if incoming?