Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use User.unlock_in in other locked account text
While this is a bit orthogonal to the current PR, I thought it was worth bringing these usages into line with the changes I made in the previous commit. This method is provided by Devise's Lockable module and reads its value from the Devise configuration. The value is returned as an `ActiveSupport::Duration` and so it can be converted into a human-readable string by calling `ActiveSupport::Duration#inspect`. I think it's clearer to use `User.unlock_in` vs `Devise.unlock_in`, because the `Devise::Lockable` module is included in the `User` model. I think using `ActiveSupport::Duration#inspect` rather than reconstructing the duration string as per the previous implementation of `EventLog::LOCKED_DURATION` is a lot simpler and easier to read. Note that these changes won't currently change what is displayed, because `Devise.unlock_in` is currently configured to be `1.hour`.
- Loading branch information