mar*_*ion 24 ruby-on-rails devise ruby-on-rails-3 ruby-on-rails-3.1
这些是将模块添加到现有Devise安装的说明:https://github.com/plataformatec/devise/wiki/How-To :-change-an-already-existing-table-to-add-devise-required -列
但我似乎无法找到必要的列timeoutable
.
我查找timeoutable
了Devise库中需要的字段:https://github.com/plataformatec/devise/blob/master/lib/devise/schema.rb - 但该模式文件中没有这样的方法.
该模型只有一个自定义方法,没有引用列:http://rdoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable
如何添加该功能?
谢谢.
rdv*_*ijk 25
timeoutable
指登录会话超时.不需要额外的列,只需将其添加到您的模型中即可.
该timeoutable
钩包含了所有的魔(来源:https://github.com/plataformatec/devise/blob/master/lib/devise/hooks/timeoutable.rb)
mon*_*ena 21
您只需要添加timeoutable
到您的用户模型:
devise :timeoutable
Run Code Online (Sandbox Code Playgroud)
并设置间隔时间config/initializers/devise.rb
:
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
config.timeout_in = 30.minutes
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9340 次 |
最近记录: |