How to store Boolean value in ActiveRecord

I have a table with a field that I want to be boolean and I want to make an ActiveRecord model for that table. How would you do it?

What I have done in the past is making the boolean field in the database an enum("true", "false"), but that makes everything weird:




  $user->isAdmin = "true";



Is it possible to make the model behave like this?




  $user->isAdmin = true;



Yes It Is :)

If you’re on MySQL, have you tried with TINYINT(1) field type? or BOOL / BOOLEAN?

Yes it is good practice to use tinyint(1),

I found better work rather than bit or enum datatype.

Thankx…