The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Problem updating child row from parent model

I developped a web site with Ruby on Rails, but I get a problem during the testing.
I have a parent table called "orders" and a child table called "line_items".
I created some data for the test in the files "test/fixtures/orders.yml" and "test/fixtures/line_items.yml".
In the file "test/unit/order_test.rb" I wrote some code to test the "Add", "Update" and "Destroy" for my model"Order".
My problem is that on the "Update" I try to update a quantity which is a field of my table "line_items" which is a child of my table "orders".

I guess I'm doing wrong, maybe it's not the way to update a child row or I probably miss something, unless we can't update a child row through a parent model.
If someone has the answer and can help me to figure out why the update doesn't work, that will be great.

Thank you.

Last edited by sweatje; Jun 6, 2006 at 06:43.
Reason: disable smilies to make code readable