Topic: boolean attribute in active record

Hi,
I have a column called is_verified as a tinyint column in my user table in mysql.

how can I convert is_verified into a boolean attribute in my user model?

I tried

attr_accessor :is_verified?

Rails threw an error.

please advice.

Thanks.

yaxm

Re: boolean attribute in active record

You shouldn't need to do anything to the model. Rails will add an "is_verified?" method automatically which should return the proper boolean value. Is this not working?

Railscasts - Free Ruby on Rails Screencasts