In Iteration G1: Capturing an order on page 171, LineItem model is displayed.
class LineItem < ActiveRecord::Base
product.price * quantity
In Iteration G1: Capturing an order on page 174. We look in the database
depot> sqlite3 -line db/development.sqlite3 SQLite version 3.6.16 Enter “.help” for instructions sqlite> select * from orders; id = 1 name = Dave Thomas address = 123 Main St email = firstname.lastname@example.org pay_type = Check created_at = 2010-06-09 13:40:40 updated_at = 2010-06-09 13:40:40 sqlite> select * from line_items; id = 10 product_id = 3 cart_id = created_at = 2010-06-09 13:40:40 updated_at = 2010-06-09 13:40:40 quantity = 1 price = 49.5 order_id = 1
My question is: When/how is the price column in line_items table created? I thought price was an attribute of the Product model.