Rails 3.2
MySQL gem
I have the following in my migration:
t.decimal :pre_tax_total, default: nil, scale: 2
t.decimal :post_tax_total, default: nil, scale: 2
Based on what I read, scale:2 will produce a decimal with 2 trailing digits.
When I run the migration, and look at the table structure, I see the following:
pre_tax_total decimal(10,0)
post_tax_total decimal(10,0)
Which means the values are getting truncated by the MySQL server. What is the ActiveRecord syntax to create these columns as decimal(10,2)?