Fixed missing recipients when Message.send_emails.
This commit is contained in:
parent
7ca561a17a
commit
fe632abf2c
1 changed files with 3 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue