By using the short hand :decimal{precision, scale}, rails generator lets you generate number migration with decimal and scale. You could use {precision, scale} or {precison-scale} or {precision.scale} shorhand:
rails g scaffold Product title:string price:decimal{8,2}
the above would generate a migration of:
t.decimal :price, :precision => 8, :scale => 2
NOTE: sadly, this feature is so broken as of the release of 3.2.0 and is addressed in the bug #4602.
Advertisement