I have a problem, I have a domain class called Cicle that calculates the value of some of its properties by making an average from a collection of other domain class called Measurement, so if any of its Measurements is updated then the Cicle should be updated too.
The problem is that I calculate the average in the beforeUpdate method but this method isn't triggered if the Cicle attributes haven't changed, and as Cicle changes its attributes in the beforeUpdate method then the changes aren't being stored.
Is this the normal behavior? is there a way to force the save even if the attributes look the same? I tried flush: true, validate: false with no luck, and should I've been calling my method before saving all the time? or this is a bug and I should tell grails? or is there a best practice that I should implement instead?
Thanks