# Boolean values with Oracle?

**URL:** <https://www.ruby-forum.com/t/boolean-values-with-oracle/53527>\
**Category:** Rails\
**Created:** [February 8, 2006, 1:23pm UTC](https://www.ruby-forum.com/t/boolean-values-with-oracle/53527 "2006-02-08T13:23:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [February 8, 2006, 1:23pm UTC](https://www.ruby-forum.com/t/boolean-values-with-oracle/53527/1 "2006-02-08T13:23:22Z")

</div>

Oracle has no boolean value type, so how do i treat fields as being  
boolean in activerecord?? I know i could rewrite the accessor methods in  
the model class to return the correct boolean value, but this seems too  
tedious and wrong.

Does anyone know a better way??

Any help is greatly appreciated,  
Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [February 8, 2006, 1:41pm UTC](https://www.ruby-forum.com/t/boolean-values-with-oracle/53527/2 "2006-02-08T13:41:19Z")

</div>

On 08/02/06, Chris [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Oracle has no boolean value type, so how do i treat fields as being  
> boolean in activerecord?? I know i could rewrite the accessor methods in  
> the model class to return the correct boolean value, but this seems too  
> tedious and wrong.
> 
> Does anyone know a better way??

ActiveRecord does the mapping automatically for you. Just make sure to  
create your ‘boolean’ column as NUMBER(1).
