Ruby on rails RubyonRails,用户停用

Ruby on rails RubyonRails,用户停用,ruby-on-rails,sorcery,Ruby On Rails,Sorcery,我正在使用魔法宝石进行用户身份验证。 我的模型是: create_table "users", :force => true do |t| t.string "email", :null => false t.string "crypted_password" t.string "salt" t.datetime "creat

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

 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\u state
更改为inactive是否安全?

您可以调用

user.setup\u激活

它将
activation\u state
设置为'pending',并创建新的
activation\u令牌

或者您可以手动将激活状态设置为“挂起”。就这些