From fe632abf2cb6ab16c5718924e19921191558d966 Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Sun, 17 Feb 2013 22:04:08 +0100 Subject: [PATCH] Fixed missing recipients when Message.send_emails. --- app/models/message.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/message.rb b/app/models/message.rb index 7b470293..ddbf16c9 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -56,6 +56,9 @@ class Message < ActiveRecord::Base def recipients User.find(recipients_ids) + rescue ActiveRecord::RecordNotFound => error + logger.warn "#{Foodsoft.env}: #{error.message}" + User.find(recipients_ids.select { |id| User.exists?(id) }.uniq) end # Sends all pending messages that are to be send as emails.