I am using Rails 4.1 and Ruby 2.1.1
I have a line in my user model:
enum role: [:user, :admin, :team_admin, :domain_admin, :super_admin]
In my controller, I only want to do something if my user is - :domain_adminand I use the following test:
if @user.role == :domain_admin
The test returns false when @user.role(in the console) returns :domain_admin. Thus, the value is set correctly, but I must be mistaken, checking its equality, or the listing does not work, as I thought before. I assumed that I read the documentation that they were thin (small).
Can someone tell me how I am testing equality for :domain_adminas well as how to test >= :domain_admin?
Many thanks.