fix mail cron send mail del log

This commit is contained in:
spen 2014-09-22 17:30:51 +08:00
parent cc82387efb
commit 0c03ba8439
1 changed files with 8 additions and 3 deletions

View File

@ -63,7 +63,6 @@ class MailCronMailer < ActionMailer::Base
end end
end end
@mail_cron_log = { @mail_cron_log = {
:mail_subject => @data.mail_subject, :mail_subject => @data.mail_subject,
:mail_to => group_mail, :mail_to => group_mail,
@ -74,10 +73,16 @@ class MailCronMailer < ActionMailer::Base
@mail_cron_log = MailCronLog.new(@mail_cron_log) @mail_cron_log = MailCronLog.new(@mail_cron_log)
@mail_cron_log.save @mail_cron_log.save
@data.destroy @mail_to_count = @data.mail_to.split(',') - group_mail.split(',')
if @mail_to_count.count == 0
@data.destroy
else
@data.mail_to = @mail_to_count.join(',')
@data.save
end
end end