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

View file

@ -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.