Persist unlock token before triggering mailer #1908

merged 1 commit into from Jun 11, 2012


None yet
2 participants

mhfs commented Jun 11, 2012

Hey guys,

The fact that the lockable module triggers the email before the token is persisted is annoying me in some specs when associated with devise-async.

Also, even tough very unlikely, the current code would allow a worker to have a tiny time frame in which it would be able to render the email before the token is persisted (devise-async loads the record from db).

This change just ensures the token is persisted before triggering the mailer.

Let me know if you need any change.


josevalim merged commit c26ed53 into plataformatec:master Jun 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment