If this is often calculated, you are probably better off storing summary statistics in a project record (total_votes). You can update the details of each vote or update it using the cron job.
I think you are looking for the following:
@totals = Vote.sum(:value,:group=>:project_id)
@projects = Project.find(:all)
then
<%=h @project.title %> has <%= @totals[@project.id] %> votes.
source
share