0

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.

Pouya
  • 65
  • 6

2 Answers2

1

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)

1

You can use User.where.not(home_state: nil)