Merge pull request #1409 from riyad/update-votes
Update votes for issues and merge requests
This commit is contained in:
commit
40eec08c99
17 changed files with 256 additions and 66 deletions
|
@ -1,6 +1,6 @@
|
|||
class Issue < ActiveRecord::Base
|
||||
include IssueCommonality
|
||||
include Upvote
|
||||
include Votes
|
||||
|
||||
acts_as_taggable_on :labels
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.join(Rails.root, "app/models/commit")
|
|||
|
||||
class MergeRequest < ActiveRecord::Base
|
||||
include IssueCommonality
|
||||
include Upvote
|
||||
include Votes
|
||||
|
||||
BROKEN_DIFF = "--broken-diff"
|
||||
|
||||
|
|
|
@ -105,6 +105,12 @@ class Note < ActiveRecord::Base
|
|||
def upvote?
|
||||
note.start_with?('+1') || note.start_with?(':+1:')
|
||||
end
|
||||
|
||||
# Returns true if this is a downvote note,
|
||||
# otherwise false is returned
|
||||
def downvote?
|
||||
note.start_with?('-1') || note.start_with?(':-1:')
|
||||
end
|
||||
end
|
||||
# == Schema Information
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue