ruby on rails 4 - How to check status of invitation? -


for each user want display invitation status: "invitation sent" or "invitation accepted"

currently check if field encrypted_password in users table contains anything. if not - user did not registered (accepted invitation) yet sent him (otherwise user's record not exist in db)

is there more elegant way it?

yes should take

is_registered:boolean

column in user table contains default value "false". have when user registered time change value "true". when ever want check user registered? do

@user.is_registered? or current_user.is_registered? 

this returns true/false


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -