如何将Devise的'timeoutable'模块添加到现有的Devise安装中? - Rails 3.1 [英] How do I add Devise's 'timeoutable' module to an existing Devise install? - Rails 3.1
问题描述
这些是将模块添加到现有Devise安装的说明: https://github.com/plataformatec/devise/wiki/How-To:-change-an-already-existing-table-to-add- devise-required-columns
These are the instructions to add a module to an existing Devise install: https://github.com/plataformatec/devise/wiki/How-To:-change-an-already-existing-table-to-add-devise-required-columns
但是我似乎找不到 timeoutable必需的列
我在Devise库中查找了 timeoutable
需要的字段: https://github.com/plataformatec/devise/blob/master/lib/devise/schema.rb - 但是在该模式文件中没有这样的方法。
I looked for the fields that timeoutable
requires in the Devise library: https://github.com/plataformatec/devise/blob/master/lib/devise/schema.rb - but there is no such method in that schema file.
模型只有一个自定义方法,不引用列: http://rdoc.info/github/plataformat ec / devise / master / Devise / Models / Timeoutable
The model just has a custom method with no reference to the columns: http://rdoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable
如何添加该功能?
谢谢。
推荐答案
timeoutable
是指登录会话超时。不需要额外的列,只需将其添加到您的模型中。
timeoutable
refers to the login session timeout. No extra columns are needed, just add it to your model.
可暂存
挂钩包含所有魔法: https://github.com/plataformatec/devise/blob/master/lib /devise/hooks/timeoutable.rb )
The timeoutable
hook contains all the magic (source: https://github.com/plataformatec/devise/blob/master/lib/devise/hooks/timeoutable.rb)
这篇关于如何将Devise的'timeoutable'模块添加到现有的Devise安装中? - Rails 3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!