My Program table has many Measures My Measure table has many Targets My Target table has a column called \"
Program
Measures
Measure
Targets
Target
What is the target.money of a Program, the sum of all Targets.money of all Measures for this Program ?
You can try something like:
Target.order_by( :money => :desc ).map{|target| target.measure }.map{|measure| measure.program }.uniq
Good luck