I need a rails command that can query all the users who has a value in home_state. I have tried to use:
User.where('home_state')
but couldn't retrieve any information from it.
CodePudding user response:
If you are looking for all users that do not have nil as a value for home_state, you can use User.where.not(home_state: nil)
CodePudding user response:
You can use User.where.not(home_state: nil)
