Commit 6a1c3a59b79fc83614a5b5eb0caa599fa9b842aa
1 parent
ba5baa01
Exists in
master
and in
1 other branch
Skips per day added to object totals per day
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
app/controllers/questions_controller.rb
@@ -239,8 +239,11 @@ class QuestionsController < InheritedResources::Base | @@ -239,8 +239,11 @@ class QuestionsController < InheritedResources::Base | ||
239 | object_type = params[:object_type] | 239 | object_type = params[:object_type] |
240 | 240 | ||
241 | @question = current_user.questions.find(params[:id]) | 241 | @question = current_user.questions.find(params[:id]) |
242 | + | ||
242 | if object_type == 'votes' | 243 | if object_type == 'votes' |
243 | hash = Vote.count(:conditions => "question_id = #{@question.id}", :group => "date(created_at)") | 244 | hash = Vote.count(:conditions => "question_id = #{@question.id}", :group => "date(created_at)") |
245 | + elsif object_type == 'skips' | ||
246 | + hash = Skip.count(:conditions => {:question_id => @question.id}, :group => "date(created_at)") | ||
244 | elsif object_type == 'user_submitted_ideas' | 247 | elsif object_type == 'user_submitted_ideas' |
245 | hash = Choice.count(:include => 'item', | 248 | hash = Choice.count(:include => 'item', |
246 | :conditions => "choices.question_id = #{@question.id} AND items.creator_id <> #{@question.creator_id}", | 249 | :conditions => "choices.question_id = #{@question.id} AND items.creator_id <> #{@question.creator_id}", |