Count +1 votes in issue notes.

This commit is contained in:
Ariejan de Vroom 2012-03-14 15:31:31 +02:00
parent ed11ca13e8
commit 8d8b82127f
6 changed files with 81 additions and 15 deletions

View file

@ -45,6 +45,11 @@ class Issue < ActiveRecord::Base
def new?
today? && created_at == updated_at
end
# Return the number of +1 comments (upvotes)
def upvotes
notes.select(&:upvote?).size
end
end
# == Schema Information
#