I have a rails app that has two models one is vender and the other is purchase_request where vender has has_many :purchase_requests and purchase_request has belongs_to :vender yet when I call destroy it will not delete fields with this vender in it, and thus crashes the application because it returns nil objects where this vender use to be. how can I fix this?
Share
It sounds like you need to use the
:dependent => :destroyoption for you association.