Fix DEPRECATION WARNING: Calling #sum with a block is deprecated and will be removed in Rails 4.1.