Rails 2.0 Booleans

Hey Guys,

Was the behaviour of Booleans changed in Rails 2.0? Prior to 2.0 an ‘f’
or ‘false’ in a column called, say ‘active’, was returned as false when
the model field ‘active?’ was called.

I searched the 2.0 change-log but I didn’t see any mention…

Sonny.

Sonny C. wrote:

Hey Guys,

Was the behaviour of Booleans changed in Rails 2.0? Prior to 2.0 an ‘f’
or ‘false’ in a column called, say ‘active’, was returned as false when
the model field ‘active?’ was called.

I searched the 2.0 change-log but I didn’t see any mention…

Sonny.

… it also appears the string ‘0’ is no longer interpreted as false.
The numeric value 0 however is still reported as false by the ‘boolean’
method.

Sonny.

On 12/26/07, Sonny C. [email protected] wrote:

Was the behaviour of Booleans changed in Rails 2.0? Prior to 2.0 an ‘f’
or ‘false’ in a column called, say ‘active’, was returned as false when
the model field ‘active?’ was called.

Sounds like you need to fix your code up to be a bit more database
agnostic. In the meantime you can add some helpers to properly
interprete your t’s and f’s.


Greg D.
http://destiney.com/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs