From 5bf016e3100e24033cc7fad18672136dad5a1ef2 Mon Sep 17 00:00:00 2001 From: amandabizzinotto Date: Fri, 5 Sep 2025 10:07:55 -0300 Subject: [PATCH] Add missing send_message method to puzzle inventory job --- app/jobs/puzzle_inventory_check_job.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/jobs/puzzle_inventory_check_job.rb b/app/jobs/puzzle_inventory_check_job.rb index f459d8c..e7d0bf0 100644 --- a/app/jobs/puzzle_inventory_check_job.rb +++ b/app/jobs/puzzle_inventory_check_job.rb @@ -16,4 +16,10 @@ def send_low_inventory_notification(count) notification_message = SlackClient::Messages::LowPuzzleInventoryNotification.new(count).create send_message(notification_message, channel_id: ENV.fetch("SHIELD_NOTIFICATIONS_CHANNEL", nil)) end + + def send_message(message, channel_id:) + SlackClient::Client.instance.chat_postMessage(channel: channel_id, blocks: message) + rescue Slack::Web::Api::Errors::SlackError + head :unprocessable_entity + end end