From 3c0627e9ea534ed4e22ce19829fd398a0c448931 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Thu, 9 Feb 2017 16:27:00 -0600 Subject: [PATCH] no voting reminders for managers --- app/workers/reviewer_reminder.rb | 3 ++- test/workers/reviewer_reminder_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/workers/reviewer_reminder.rb b/app/workers/reviewer_reminder.rb index 58fbdb6..7e67da6 100644 --- a/app/workers/reviewer_reminder.rb +++ b/app/workers/reviewer_reminder.rb @@ -26,7 +26,8 @@ class ReviewerReminder from reviewer_votes rev inner join users u on u.id = rev.user_id inner join candidates c on c.id = rev.candidate_id - where rev.vote = 0 and rev.veto = 0 and u.active is not false;" + where rev.vote = 0 and rev.veto = 0 + and u.role != 'manager' and u.active is not false;" ActiveRecord::Base.connection.exec_query(sql) end end diff --git a/test/workers/reviewer_reminder_test.rb b/test/workers/reviewer_reminder_test.rb index 08101d3..c4399dd 100644 --- a/test/workers/reviewer_reminder_test.rb +++ b/test/workers/reviewer_reminder_test.rb @@ -2,9 +2,9 @@ require 'test_helper' class ReviewerReminderTest < ActiveSupport::TestCase - test "collection is created with four results" do + test "collection is created with results" do reminders = ReviewerReminder.new - assert_equal 3, reminders.size + assert_equal 6, reminders.size end test "each reminder has needed attributes" do