Fixed missing recipients when Message.send_emails.

This commit is contained in:
Benjamin Meichsner 2013-02-17 22:04:08 +01:00
parent 7ca561a17a
commit fe632abf2c
1 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,9 @@ class Message < ActiveRecord::Base
def recipients def recipients
User.find(recipients_ids) 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 end
# Sends all pending messages that are to be send as emails. # Sends all pending messages that are to be send as emails.