0

Hey guys im using this Devise model : https://github.com/plataformatec/devise/wiki/How-To%3a-Require-admin-to-activate-account-before-sign_in

do anyone know where i can change it so that Devise uses my is_approved instead of the default approved ?

for some reason i cant use the default approved since sqlite wont update the bool attribute more info about that here : Rails 3 and SQLite communications concerning boolians

After i have approved a user on my website Device gives an error "user not approved" but i cant find in my app where i can change this ?

Community
  • 1
  • 1
Matti
  • 495
  • 6
  • 21

1 Answers1

0

Never mind i found it, it was so obvious that i almost dont want to share it lol

but in case anyone is ever wondering about it, then you just have to change

def active_for_authentication? 
  super && "your attribute"? 
end 

def inactive_message 
  if !"your attribute"? 
   :not_approved 
 else 
    super # Use whatever other message 
 end 
end

the 2 places where i put "your attribute" this should be in your user model

Matti
  • 495
  • 6
  • 21