Ignore:
Timestamp:
Aug 30, 2010, 5:22:25 PM (10 years ago)
Author:
duh
Message:
  • added method to properly delete Assays from study
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r862 r863  
    227227         */
    228228        def deleteAssay(Assay assay) {
    229                 // remove this assay from the study
    230                 this.removeFromAssays( assay )
     229                if (assay && assay instanceof Assay) {
     230                        // iterate through linked samples
     231                        assay.samples.findAll { true }.each() { sample ->
     232                                assay.removeFromSamples(sample)
     233                        }
     234
     235                        // remove this assay from the study
     236                        this.removeFromAssays(assay)
     237
     238                        // and delete it explicitly
     239                        assay.delete()
     240                }
    231241        }
    232242
Note: See TracChangeset for help on using the changeset viewer.