Topic: Legacy DB "Zero" dates
There is an application that I'm working on, where the original developers made a date column in the database called 'checked_out', and made the default value be '0000-00-00'. Large portions of the existing application then check to see if the check out date is this value, if so then it has never been checked out, if not then it has the checkout date.
The problem I'm running into is that this is an invalid date, so Ruby can't generate a corresponding date. This is fine when editing, as the Date object just parses it as nil and I can work with that. However on creating a new object, I can't seem to get the system to fill the field with the default value, as rails trys to pass it null, and the field can't have a null value. Further, in order for the data to function properly with the existing application it needs to make the new items have a date of '0000-00-00'.