I’m connecting to a legacy MySQL database that was originally created using Microsoft Access. It continues to be accessed by Access, in addition to Rails.
Boolean fields are defined as
tinyint(1) and use
false. But, it uses
true. It seems that this is what Microsoft Access uses as the true value, and it needs to continue using -1 because there are still Access applications that use the database.
Is there any configuration parameter or hook that I can use in Rails to redefine what the MySQL adapter uses for the TRUE value?
before_save hook to rewrite
active = true to
active = -1 but it seems to send the DB query using
UPDATE `imaster` SET `imaster`.`active` = TRUE WHERE `imaster`.`4Digit` = '1605'
Maybe this is something that has to be done on the MySQL end but that may be hard to get authorization to do. If I could find a way to do it from the Rails side it would be ideal.