Count +1 votes in issue notes.
This commit is contained in:
parent
ed11ca13e8
commit
8d8b82127f
6 changed files with 81 additions and 15 deletions
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue