Hi,
It appears to me that the command:
ruby script/generate scaffold whatever money_field:decimal(10,2)
will not generate a valid migration.
Therefore it appears to me only two ways to achieve the desired result
is:
1.1 Omit the the precision/scale on the scaffold command
1.2 Edit the migration file by following the “do |t| … end” with
the command:
change_column :whatever :money_field, :amount, :decimal,
:precision
=> 10, :scale => 2
I think this approach worked for me
2.1 Omit the money_field in it’s entirety
2.2 Create a second migration file an add the command:
add_column :whatever :money_field, :amount, :decimal, :precision
=> 10, :scale => 2
I’m guessing this will work as well
BTW, I’m running Rails 2.3.5, Ruby 1.8.6, WinXP-Pro/SP3, Firefox
3.6.2, Firebug 1.5.3,
MySQL 5.0.37-community-nt, Mongrel, Apache HTTP Server 2.2.15
What do you think?
Best wishes,
Richard