I use enum
for a column in my users
table. I want to be able to find all users who are not pending. This is my current code:
enum approval_status: [:pending, :approved, :declined]
User.where.not(approval_status: :pending)
But the SQL query becomes this:
User Load (0.5ms) SELECT `users`.* FROM `users` WHERE (`users`.`approval_status` != NULL)
No matter what enum value I put in, the SQL turns it to NULL
How do I get ALL users, EXCEPT for a particular value of the approval_status column?