非常に単純に思えますが、そうではありません。
私は2つの値を持っています:
t.integer "quantity"
t.decimal "unit_price", :precision => 7, :scale => 2
each (invoice) ループで、数量に unit_price を掛けたい:
invoice.quantity * invoice.unit_price
これにより、次のエラーが発生します。
undefined method `*' for nil:NilClass
最初に値を変換する必要がありますか、それとも些細なことで不足していますか?
ありがとう