Does dependent destroy work with polymorphic=>true? Otherwise, should I overload destroy, destroying the item, and then deleting the item via the class delete to avoid the recursive destroy? This doesn't work: class FolderLinking < ActiveRecord::Base belongs_to :folder_linkable, :polymorphic => true, :dependent=> :destroy when an instance of FolderLinking is destroyed, I want the item that it links to destroyed. I'm currently seeing the folder_linkable sticking around.
on 2007-04-25 02:54
on 2007-04-27 22:26
Yottameter <yottameter@...> writes: > > belongs_to :folder_linkable, :polymorphic => > true, :dependent=> :destroy > Specifying :dependent=> :destroy on the has_one declaration causes the "parent" to be destroyed with the resource. You must, however, destroy the resource, not the parent, which seems a bit upside-down. -wcpr-