/ Published in: Ruby
URL: http://www.therailsway.com/2007/1/10/assetsgraphed-part-2
Expand |
Embed | Plain Text
# use Array#inject to calculate totals def number_of_incomings assets.inject(0) {|total, asset| total += asset.incomings.size } end
You need to login to post a comment.
