From ed2e8c3ed7d0ddbe750ba435f4a055e9094261a8 Mon Sep 17 00:00:00 2001 From: cbmarcum Date: Sun, 27 Oct 2019 16:39:39 -0400 Subject: [PATCH] Refs #81 - changes copied from master branch commit 1dbd5bd --- .../mybusiness/ProductController.groovy | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/grails-app/controllers/net/codebuilders/mybusiness/ProductController.groovy b/grails-app/controllers/net/codebuilders/mybusiness/ProductController.groovy index 5b29c80..3dcba73 100644 --- a/grails-app/controllers/net/codebuilders/mybusiness/ProductController.groovy +++ b/grails-app/controllers/net/codebuilders/mybusiness/ProductController.groovy @@ -408,7 +408,20 @@ class ProductController { notFound() return } + + // since we're not using belongsTo because the database is established + // we'll delete the join table references manually. + product.goodIdentifications.each { gid -> + log.info("deleting goodId ${gid.toString()}") + gid.delete() + } + product.productFeatureAppls.each { pfa -> + log.info("deleting pfa ${pfa.toString()}") + pfa.delete() + } + product.save() + product.delete flush: true request.withFormat {