I am using sorcery gem for user authentication. My model is:
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
I could not find in the internet if there is a built-in function for deactivating a user. Will it be safe to find a user and just change the parameter activation_state
to inactive?
You can call
user.setup_activation
it will set activation_state
to 'pending' and create new activation_token
.
Or you can set activation_state
to 'pending' manually. That's all.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다