0

我正在使用魔法 gem 进行用户身份验证。我的模型是:

 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为非活动状态是否安全?

4

1 回答 1

1

你可以打电话

user.setup_activation

它将设置activation_state为“待定”并创建新的activation_token.

或者您可以activation_state手动设置为“待定”。就这样。

于 2014-10-28T17:48:30.417 回答