2014-10-28 76 views
0

我使用魔法宝石进行用户认证。 我的模式是:红宝石在轨,禁用用户

create_table "users", :force => true do |t| 
    t.string "email",               :null => false 
    t.string "crypted_password" 
    t.string "salt" 
    t.datetime "created_at",              :null => false 
    t.datetime "updated_at",              :null => false 
    t.string "remember_me_token" 
    t.datetime "remember_me_token_expires_at" 
    t.string "activation_state" 
    t.string "activation_token" 
    t.datetime "activation_token_expires_at" 
end 

我不能在互联网上找到,如果有对停用的用户的内置功能。找到一个用户是否安全,只需将参数activation_state更改为非活动状态?

回答

1

您可以拨打

user.setup_activation

它将设置activation_state为 '待定',创造新的activation_token

或者您可以手动将activation_state设置为“挂起”。就这样。