Additional Fields in a Join Table


I am creating an order management web application, and have run into an
issue over join tables. I am reading Agile Web D. and it says
that I can put additional fields within my join tables, and they give
the example of a date field.

I want to know if it is possible to do the following:

I have an orders table with the order information as well as an
orders_items table and an items table

It is a habtm relationship. I need to be able to update the item
information for the specific order without changing it in the items
table (ie. the items table holds the default values for the item, and
the orders_items table holds the updated values, such as price, and

Is it possible to leave the field names the same between both the
order_items table and the items table (both would have a price field).

I have been reading that there are problems when accessing these fields?
Is this the proper way of doing this?

Ryan L.

Attributes in HABTM tables have been superseded by has_many and
:through. You get the same benefits, but can also do more because the
join table is now a full-blown model.

and of course the API docs at:

Hope this helps.

Sorry about the slow response. So far this has worked for me. Thanks
for your help!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs