这些是将模块添加到现有设计安装的说明:https://github.com/plataformatec/devise/wiki/How-To:-change-an-already-existing-table-to-add-devise-required-columns
但我似乎找不到 timeoutable
的必要列.
我查找了 timeoutable
的字段在设计库中需要:https://github.com/plataformatec/devise/blob/master/lib/devise/schema.rb - 但该架构文件中没有这种方法。
该模型只有一个没有引用列的自定义方法:http://rdoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable
如何添加该功能?
谢谢。
请您参考如下方法:
timeoutable
指登录 session 超时。不需要额外的列,只需将其添加到您的模型中。timeoutable
钩子(Hook)包含所有的魔法(来源:https://github.com/plataformatec/devise/blob/master/lib/devise/hooks/timeoutable.rb)