Commit Graph

9 Commits

Author SHA1 Message Date
Carlos Antonio da Silva a3ae35e9c9 Create a model hook around the lockable warden hook to reset attempts
Resetting failed attempts after sign in happened inside a warden hook
specific for the lockable module, but that was hidden inside the hook
implementation and didn't allow any user customization.

One such customization needed for example is to direct these updates to
a write DB when using a multi-DB setup. With the logic hidden in the
warden hook this wasn't possible, now that it's exposed in a model
method much like trackable, we can override the model method to wrap it
in a connection switch block for example, point to a write DB, and
simply call `super`.

Closes #5310
Related to #5264 and #5133
2021-04-02 15:45:25 -03:00
Pat Allan f39c6fd927 Add the frozen_string_literal pragma comment to all Ruby files. (#4725) 2017-12-21 15:36:29 -02:00
Nicolas Viennot e841c4c5ef Reduce ORM API surface 2016-07-13 12:48:12 -04:00
Anshul Sharma dc1b399a8b Updated ruby 1.9 hash syntax 2014-02-25 22:12:55 +05:30
Alexander Zubkov b9112d4308 Handle nil failed_attempts 2013-09-02 14:48:19 +04:00
julp 7670eb8e98 don't update failed_attempts attribute if already equal to 0 2013-05-29 19:24:51 +02:00
José Valim 4a24667e80 Revert "Rails 3.2.7 deprecates update_attribute in favor of update_column"
Rails 3.2.8 is rolling back the deprecations.

This reverts commit 7d41072c0e.
2012-08-05 09:24:10 -03:00
Fabio Kreusch 7d41072c0e Rails 3.2.7 deprecates update_attribute in favor of update_column. Updated projects using Devise output lots of warnings because Devise uses the deprecated version in some places. This commit replaces update_attribute with update_column to fix that. 2012-07-27 17:25:21 -03:00
Rodrigo Flores e6af9763fd Hook should be on lockable not recoverable and removed an useless comment 2012-03-19 18:06:20 -03:00