Small code optimizations

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.