Commit cf82561669d317e4376f54f3a6843686089f7a24

Authored by Luke Baker
2 parents bd1697d3 bc25e131

Merge branch 'master' into sessions-with-vote

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/question.rb
... ... @@ -735,7 +735,7 @@ class Question < ActiveRecord::Base
735 735 # total number of sessions with at least one vote
736 736 def sessions_with_vote
737 737 Question.connection.select_one("
738   - SELECT COUNT(DISTINCT(appearances.voter_id)) from appearances LEFT JOIN votes ON (votes.voter_id = appearances.voter_id) WHERE votes.id IS NOT NULL AND appearances.question_id = #{self.id}
  738 + SELECT COUNT(DISTINCT(voter_id)) FROM votes WHERE votes.question_id = #{self.id}
739 739 ").values.first
740 740 end
741 741  
... ...