From 06c1a8a9ae34e2a4fe7b4f4edb58bacfaf6df5c9 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Sat, 8 Sep 2012 02:08:35 +0200 Subject: Make notes recognize downvotes --- app/models/note.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/note.rb') 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 # -- cgit v1.2.1