sql

Order by field mysql command doesn't work, gives wrong order

Hi. I have a strange problem. I tried this command in mysql: SELECT `type`, `bought` FROM cars WHERE owner = 'test' ORDER BY type And it prints out this in phpmyadmin: type bought -------------------- 17 1281025497 22 1287708417 22 1287347244 24 1287708324 24 1287876461 6 12878...

Shortcomings of modelling roles as boolean columns on User table

I'm working on a Rails app using CanCan for RBAC and I only have 3 roles and maybe I'll add 1 or 2 more somewhere down the track. In the past I've always had roles as their own entity, joined to users via a m2m link-table. With so few, and static, roles, that seems like overkill. So I'm thinking of simply adding boolean columns to my ...