NoamB/sorcery — pull request #275 by stephan778 (2012-04-24 18:08:28+00:00)
Title: Brute force protection: Fix unlock token for Mongoid and MongoMapper

Hi,

Here's a quick fix for unlock token feature (introduced in #249). The problem was that it didn't define `unlock_token` field for Mongoid (and MongoMapper) and still tried to access it inside `after_update` callback.

I also took the liberty to move email sending inside `lock!` method, I believe it will be better to only send an email once instead of sending it every time model is saved.

Thanks.