schedule.rb
every 3.minutes do
runner "Audit.capa_pending_auto_follow_up"
end
应用程序/邮寄者/ user_mailer.rb
def capa_pending_auto_follow_up(audit,current_user)
@audit = audit
@user = current_user
mail(:to => @audit.auditee_email, :subject => "CAPA Pending Auto Follow Up")
end
模型/ audit.rb
def self.capa_pending_auto_follow_up
@audits_capa_pending = []
@audits = Audit.all
@audits.each do |audit|
audit.findings.each do |finding|
if finding.status_id == "CAPA Pending" || finding.status_id == ""
@audits_capa_pending << audit
break
end
end
end
@audits_capa_pending.each do |audit|
UserMailer.capa_pending_auto_follow_up(audit,current_user).deliver
end
@user = User.all
@user.each do |u|
UsersMailer.weekly_mail(u).deliver
end
end
end
这是我的项目中的代码我运行的服务器&#34; rails server&#34; 但我在#34; schedule.rb&#34;中提到的每3分钟没有收到邮件给我。代码中是否有任何错误请帮帮我