Permalink
Browse files

Merge pull request #336 from longwa/GRAILS-9412

Fix issue where calling validate() after a domain class is reloaded with...
  • Loading branch information...
2 parents a0f21de + 27685c4 commit 105c1358a98876775cab825fcc07b66bba1c90ab @graemerocher graemerocher committed Mar 13, 2013
@@ -379,16 +379,16 @@ Using Grails' default naming strategy: '${ImprovedNamingStrategy.name}'"""
proxyIfReloadEnabled = false
}
}
-
- if(event.source instanceof Class) {
- GrailsDomainClass dc = application.getDomainClass(event.source.name)
- if (!dc.abstract && GrailsHibernateUtil.usesDatasource(dc, datasourceName)) {
- "${dc.fullName}Validator$suffix"(HibernateDomainClassValidator) {
- messageSource = ref("messageSource")
- domainClass = ref("${dc.fullName}DomainClass")
- sessionFactory = ref("sessionFactory$suffix")
- grailsApplication = ref("grailsApplication", true)
- }
+ }
+
+ if(event.source instanceof Class) {
+ GrailsDomainClass dc = application.getDomainClass(event.source.name)
+ if (!dc.abstract && GrailsHibernateUtil.usesDatasource(dc, datasourceName)) {
+ "${dc.fullName}Validator$suffix"(HibernateDomainClassValidator) {
+ messageSource = ref("messageSource")
+ domainClass = ref("${dc.fullName}DomainClass")
+ sessionFactory = ref("sessionFactory$suffix")
+ grailsApplication = ref("grailsApplication", true)
}
}
}

0 comments on commit 105c135

Please sign in to comment.