I've seen a few posts about why it's bad to inject logic into your domain classes, and i haven't actually figured out how to inject 'grailsApplication'.
I'm looking to setup Domain Class index TTL values by Grails Environment. I don't want documents living in Mongo past 24 hours on my Integration environment.
Using Grails 2.4.3, and Gorm 3.1.4.
Does anyone have a better pattern for this?
This code wouldn't work, but this is the concept if grailsApplication could be injected
static mapping = {
version false
createdOn index:true, indexAttributes:[expireAfterSeconds:grailsApplication.config.DEFAULT_AGEOFF_IN_SECONDS]
}