Forum: Ruby on Rails Boolean values with Oracle?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris (Guest)
on 2006-02-08 14:23
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
Łukasz Piestrzeniewicz (Guest)
on 2006-02-08 14:41
(Received via mailing list)
On 08/02/06, Chris <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).
This topic is locked and can not be replied to.