# Boolean with mysql as tinyint,but set true value as '-1'

**URL:** <https://www.ruby-forum.com/t/boolean-with-mysql-as-tinyint-but-set-true-value-as-1/90217>\
**Category:** Rails\
**Created:** [March 26, 2007, 8:53pm UTC](https://www.ruby-forum.com/t/boolean-with-mysql-as-tinyint-but-set-true-value-as-1/90217 "2007-03-26T20:53:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bumpspowdersteeps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@bumpspowdersteeps](https://www.ruby-forum.com/u/bumpspowdersteeps)\
**Post date:** [March 26, 2007, 8:53pm UTC](https://www.ruby-forum.com/t/boolean-with-mysql-as-tinyint-but-set-true-value-as-1/90217/1 "2007-03-26T20:53:23Z")

</div>

Hello,

We are developing a rails application, migrated from an Access front  
end with sqlserver backend to a rails, mysql project, but we still  
would like the Access front end to be able to connect to the mysql  
database and use the application through both methods of connection.

Have converted the SQL servers boolean types to tinyint(1) for the  
MySQL and rails,but turns out the old MS Access front end needs ‘TRUE’  
to be a value of ‘-1’ in order for its checkboxes to work. On the  
MySQL we have set 0- for false, and 1 for True, which works great for  
Rails out of the box, but…

Is there any way in a rails model declaration to have active record  
store and understand ‘-1’ as ‘TRUE’ rather than ‘1’ as ‘TRUE’ ???

Thanks

Jason
