I also checked out Dave Thomas's blog and in one of his recent posts he points out that Rails now embraces decimal database fields:
“In the Rails trunk, numeric and decimal database columns with a scale factor are now converted into Ruby BigDecimal objects. If the scale factor is zero, they instead become integers.That is great news, and I'm really looking forward to not needing to use the workaround I previously found.
Migrations now support decimal columns too, with the addition of two new attributes, precision and scale.add_column :orders, :price,I just spent a day reworking all the Depot chapters to use this, and it seems to work great.”
:decimal, :precision => 8, :scale => 2
No comments:
Post a Comment