Permalink
Browse files

simplify votes vs skips per session code

  • Loading branch information...
lukebaker committed Aug 7, 2012
1 parent c359cc6 commit 48d258f370c06d83fd15faf82e6fb8fa37fa3b37
Showing with 2 additions and 12 deletions.
  1. +2 −12 app/controllers/questions_controller.rb
@@ -419,19 +419,9 @@ def scatter_plot_user_vs_seed_ideas
def scatter_votes_vs_skips
@earl = Earl.find params[:id]
@question = Question.new(:id => @earl.question_id)
- votes = @question.get(:object_info_by_visitor_id, :object_type => 'votes')
-
- skips = @question.get(:object_info_by_visitor_id, :object_type => 'skips')
-
- votes_by_sids = {}
- votes.each do |v|
- votes_by_sids[v["visitor_id"]] = v["count"]
- end
+ votes_by_sids = object_info_to_hash(@question.get(:object_info_by_visitor_id, :object_type => 'votes'))
- skips_by_sids = {}
- skips.each do |s|
- skips_by_sids[s["visitor_id"]] = s["count"]
- end
+ skips_by_sids = object_info_to_hash(@question.get(:object_info_by_visitor_id, :object_type => 'skips'))
chart_data = []
max_x = 0

0 comments on commit 48d258f

Please sign in to comment.