I have a custom validator in a domain class that refers to a config property:
accountExpirationDate (
nullable:true,
validator: { val, obj ->
if (val > new Date() + CH.config.EXPIRATION_WINDOW_DAYS) return ['date_too_late']
})
where CH is org.codehaus.groovy.grails.commons.ConfigurationHolder
Since ConfigurationHolder is deprecated, I need to get rid of it. I have tried using grailsApplication in its place but it does not work in this instance. Is there another way?
Add a dependency injection for
grailsApplication, and then you can access that from theobjinstance