Commit 10d6025daf0f0dc135fbb27745cebaf6e484c661
1 parent
6a1c3a59
Exists in
master
and in
1 other branch
Skips per session
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
app/controllers/questions_controller.rb
| ... | ... | @@ -161,6 +161,16 @@ class QuestionsController < InheritedResources::Base |
| 161 | 161 | votes_by_visitor_id.each do |visitor| |
| 162 | 162 | visitor_id_hash[visitor.thevi] = visitor.the_votes_count |
| 163 | 163 | end |
| 164 | + elsif object_type == "skips" | |
| 165 | + skips_by_visitor_id= Skip.all(:select => 'visitors.identifier as thevi, count(*) as the_votes_count', | |
| 166 | + :joins => :skipper, | |
| 167 | + :conditions => {:question_id => @question.id }, | |
| 168 | + :group => "skipper_id") | |
| 169 | + | |
| 170 | + | |
| 171 | + skips_by_visitor_id.each do |visitor| | |
| 172 | + visitor_id_hash[visitor.thevi] = visitor.the_votes_count | |
| 173 | + end | |
| 164 | 174 | elsif object_type == "uploaded_ideas" |
| 165 | 175 | |
| 166 | 176 | uploaded_ideas_by_visitor_id = @question.choices.find(:all, :select => 'creator_id, count(*) as ideas_count', | ... | ... |