From 162ae3bd28ca1b0f389eef14064f8b5387beb81a Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Tue, 21 Oct 2025 23:35:51 +0900 Subject: [PATCH 1/2] message.list.name --- app/models/message.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/message.rb b/app/models/message.rb index fc561a9..bd4f2c6 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -87,6 +87,10 @@ def from_string(str) end end + def list + @list ||= List.find_by_id(list_id) + end + def count_recursively(count = 0) count + 1 + (children&.sum(&:count_recursively) || 0) end From 9a307825130ce6e5fd2f471fc3891ac71bf5ef15 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Tue, 21 Oct 2025 23:36:14 +0900 Subject: [PATCH 2/2] oops. --- bin/import_mails | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/import_mails b/bin/import_mails index a5e2a2f..1678060 100755 --- a/bin/import_mails +++ b/bin/import_mails @@ -34,7 +34,7 @@ Message.transaction do STDERR.puts("#{list}:#{seq} already exists in Postgres") rescue StandardError => e errors << [seq, e] - STDERR.puts("failed to import #{list}:#{seq}: #{e}") + STDERR.puts("failed to import #{list.name}:#{seq}: #{e}") end end end