small medium large xlarge

10 Sep 2008, 05:45
Sergio Mendez (1 post)

On page 143 the code example shouldnt start with the line of code

class CreateOrders < ActiveRecord::Migration


10 Sep 2008, 11:36
Sam Ruby (633 posts)

Good catch. I’ll fix that in the next beta.

26 Nov 2008, 00:38
Ron Gainey (1 post)

Very much a newbie, and sorry if this is answered elsewhere (I did look around a bit), but is there something odd at this point in the book, or am I just missing something fundamental? After running generate the discussion of the line_item migration discusses the “foreign keys” in this table, referencing the “orders” and “products” tables. And the demo code shows these fields and keys commented out, as thought they were there in the generated code, to be replaced by the non-foreign key code below.

My code showed nothing of the sort, furthermore, I do not see how it would be expected to be so, the generate command had merely a set of fields with associated data type:

ruby script/generate scaffold line_item product_id:integer order_id:integer quantity:integer total_price:decimal

There is nothing in this statement to indicate any relationship between these columns and any other table, right? What am I missing, or is this a typo?

You must be logged in to comment