Rails + Devise + delayed_job? [英] Rails + Devise + delayed_job?
本文介绍了Rails + Devise + delayed_job?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将Devise与delayed_job一起使用?任何方式设置Devise使用delayed_job?
解决方案
从Robert May: https://gist.github.com/659514
将其添加到 config /初始化器
目录:
模块设计
模块模型
模块可确认
handle_asynchronously:send_confirmation_instructions
end
module可恢复
handle_asynchronously:send_reset_password_instructions
end
module可锁定
handle_asynchronously:send_unlock_instructions
end
end
end
I have a Rails 3 App using Devise on Heroku. Problem is I'm sending emails with Sendgrid and email delivery is slow, it makes the app hang. So I'm interested in using delayed_job to queue the email delivery in the background so my app is responsive to the user.
How can Devise be used with delayed_job? Any way to setup Devise to use delayed_job?
解决方案
From Robert May: https://gist.github.com/659514
Add this to a file in config/initializers
directory:
module Devise
module Models
module Confirmable
handle_asynchronously :send_confirmation_instructions
end
module Recoverable
handle_asynchronously :send_reset_password_instructions
end
module Lockable
handle_asynchronously :send_unlock_instructions
end
end
end
这篇关于Rails + Devise + delayed_job?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文