I changed a few lines of code. I added small optimization for available roles and also has_role? method use DB to check if user has role, not pluck all roles.
I added the exists? checks in 19d0fca. Now the rest of your PR cannot be cleanly merged. Can you make the other changes again so you can show up in the contributors list? Thanks!
I changed a few lines of code. I added small optimization for available roles and also has_role? method use DB to check if user has role, not pluck all roles.