2014-10-28 3 views
0

나는 사용자 인증을 위해 마법 보석을 사용하고 있습니다. 내 모델은 다음과 같습니다Ruby on rails, 사용자 비활성화

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

당신은 '보류'로 activation_state을 설정합니다

user.setup_activation

를 호출하고 activation_token 새를 만들 수 있습니다.

activation_state을 수동으로 '대기 중'으로 설정할 수 있습니다. 그게 다야.