7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/jobs/collavre_slack/slack_inbound_message_delete_job.rb', line 7
def perform(payload)
with_slack_error_handling("SlackInboundMessageDeleteJob") do
data = payload.with_indifferent_access
= Collavre::Comment.find_by(id: data[:comment_id])
if
.instance_variable_set(:@from_slack, true)
.destroy!
Rails.logger.info("[CollavreSlack] Deleted comment #{data[:comment_id]} from Slack deletion")
end
if data[:slack_comment_link_id].present?
SlackCommentLink.find_by(id: data[:slack_comment_link_id])&.destroy
end
end
end
|