[Rails] Re: Re: BigDecimal column type?

Ashley Moran work at ashleymoran.me.uk
Wed Apr 12 09:39:30 GMT 2006


On Tuesday 04 April 2006 14:47, kris wrote:
> 04/04/2006 14:47
>    
> Any news on this.. very much needed!

Kris,

Last night I ported the decimal patch I've been working on to MySQL.  If you 
want to try it you will need to freeze edge or gem into your application 
directory, then apply the patch.  Note that the PostgreSQL adapter has 
recently been modified in the Rails trunk, so the patch will fail against the 
1.1 code (and I think 1.1.1 too).  But this should not affect you using 
MySQL.

Also, I still have to add two lines to SchemaDumper so it will dump the 
precision and scale of decimals.  This means that if you test an app with 
decimal columns, they will get the database default precision and scale.  I 
didn't notice this at first because I use Postgres, and that defaults to 
using the maximum values available.  However, SQL standard says the scale 
should default to 0, so you will end up with integers coming out of your test 
database.  Just a heads up.

Here is the patch:

http://dev.rubyonrails.org/ticket/4274

Let me know if you have any issues with it (or even better post on the trac 
page)

Ashley


More information about the Rails mailing list