app/models/valuation/lifetime_donations.rb in artfully_ose-1.1.0 vs app/models/valuation/lifetime_donations.rb in artfully_ose-1.2.0.alpha.1
- old
+ new
@@ -24,12 +24,12 @@
# This could be done (probably faster) in a single sql SELECT SUM suery
#
def calculate_lifetime_donations
self.lifetime_donations = 0
lifetime_orders.each do |o|
- o.donations.each { |i| self.lifetime_donations = self.lifetime_donations + i.price}
+ o.donations.each { |i| self.lifetime_donations = self.lifetime_donations + i.total_price}
end
save
- lifetime_donations
+ self.lifetime_donations
end
end
end
\ No newline at end of file