Changeset 1373 for trunk/grails-app/domain
- Timestamp:
- Jan 12, 2011, 2:42:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy
r1314 r1373 82 82 def error = false 83 83 84 // check whether obj.parent.samples is not null at this stage to avoid null pointer exception 84 85 if (obj.parent) { 85 86 86 // check if there is exactly one sample with this name in the study (this one) 87 if (obj.parent.samples.findAll{ it.name == obj.name}.size() > 1) { 88 error = true 89 errors.rejectValue( 90 'name', 91 'sample.UniqueNameViolation', 92 [obj.name, obj.parent] as Object[], 93 'Sample name {0} appears multiple times in study {1}' 94 ) 87 if (obj.parent.samples) { 88 89 // check if there is exactly one sample with this name in the study (this one) 90 if (obj.parent.samples.findAll{ it.name == obj.name}.size() > 1) { 91 error = true 92 errors.rejectValue( 93 'name', 94 'sample.UniqueNameViolation', 95 [obj.name, obj.parent] as Object[], 96 'Sample name {0} appears multiple times in study {1}' 97 ) 98 } 95 99 } 96 100 }
Note: See TracChangeset
for help on using the changeset viewer.