Topic: Columns of type "double" and unit tests
Have been hunting around for a while on various Rails forums and have not found anything mentioning this...
Ruby: ruby 1.8.4 (2005-12-24) [x86_64-linux]
MySQL: mysql Ver 14.12 Distrib 5.0.24a, for pc-linux-gnu (x86_64) using readline 5.1
We have some tables that have columns of type "double". We can use migrations to create these columns just fine. However, when we run unit tests that check values of these columns, the tests fail because the test database gets generated with all the double columns changed to float columns.
I've poked around in the ActiveRecord code and have found that columns of type double really aren't supported. It seems like the migrations we have written that define columns of type double are working due to an accident, not by design. I know that the ruby type Float is double-precision and will handle the MySQL double columns values, but the ActiveRecord code that creates the test database schema when running tests just doesn't do the right thing.
My question: is this a bug or by design? If it is by design, should I just rewrite the tests to ignore the precision of the results?