summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-08 02:08:35 +0200
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-09-08 16:05:48 +0200
commit06c1a8a9ae34e2a4fe7b4f4edb58bacfaf6df5c9 (patch)
treecb195dda9c5d668aaeba026747fef1a43e731b6a /app/models/note.rb
parentcc7c6d53966e7501da0af87481b7e7ef2b2025c2 (diff)
downloadgitlab-ce-06c1a8a9ae34e2a4fe7b4f4edb58bacfaf6df5c9.tar.gz
Make notes recognize downvotes
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index d8494edd532..4c46c7dfffa 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -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
#