# Rails 2.0 Booleans

**URL:** <https://www.ruby-forum.com/t/rails-2-0-booleans/124235>\
**Category:** Rails\
**Created:** [December 26, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/rails-2-0-booleans/124235 "2007-12-26T20:43:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [December 26, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/rails-2-0-booleans/124235/1 "2007-12-26T20:43:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [December 26, 2007, 8:45pm UTC](https://www.ruby-forum.com/t/rails-2-0-booleans/124235/2 "2007-12-26T20:45:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [December 27, 2007, 12:05am UTC](https://www.ruby-forum.com/t/rails-2-0-booleans/124235/3 "2007-12-27T00:05:35Z")

</div>

On 12/26/07, Sonny C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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/](http://destiney.com/)
