Forum: Ruby on Rails substruct

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ce953bec3af375ddc75e375233112b28?d=identicon&s=25 harper (Guest)
on 2007-01-25 16:07

i'm developing an cool store-app, based on the substruct store
developed by technowenie. ( i think ). cool store, but i've run into the
following problem:

Product - Image:

in substruct a product HABTM to images (and vice versa) but whenever
creating an image for a specific product ([:product]   ) all of the prior ones seem to
vanish \ are destroyed. The relashinship is of HABTM (and there is a
join_table called images_products) but for some reason it works like it
is a regular belongs_to relashinship.

i checked the models, and those only have has_and_belongs_to_many on
both models (image.rb, product.rb) .

why would the prior images of a product be deleted (also from the
public/image/..path as well as the corresponding record in the join
table images_products) if the relashinship is soley HABTM? (there's no
dependent--> destroy, and even if there was, i aint destroyin nothin!
i'm creating a new image for an existing product...)


anyone run into this? have an idea why this should be happening?
many thanx.

This topic is locked and can not be replied to.