From a6384af527126e61c972ce3fe791b7ee4259162e Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 20 Sep 2016 11:44:43 +0200 Subject: [PATCH] updates query to be more efficient --- app/models/poll/voter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/poll/voter.rb b/app/models/poll/voter.rb index 936d8af3b..a517c3f34 100644 --- a/app/models/poll/voter.rb +++ b/app/models/poll/voter.rb @@ -19,7 +19,7 @@ class Poll end def has_voted? - poll.voters.where(document_number: document_number, document_type: document_type).present? + poll.voters.where(document_number: document_number, document_type: document_type).exists? end def name