Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove rescue from get_distributions

  • Loading branch information...
commit f912dc467660bb2b69514f63ac2e872c69aab963 1 parent f29d600
@lukebaker lukebaker authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 app/controllers/abingo_dashboard_controller.rb
View
14 app/controllers/abingo_dashboard_controller.rb
@@ -146,10 +146,20 @@ def get_distributions(session_list, objects_by_session_ids, alternatives)
uploader_distribution[a.content] = Hash.new(0)
end
session_list.each do |s|
- num = objects_by_session_ids[s['session_id']]['votes'] rescue 0
+ sess = objects_by_session_ids[s['session_id']]
+ if sess.nil?
+ num = 0
+ else
+ num = sess['votes']
+ end
voter_distribution[s['content']][num.to_i] +=1
- num = objects_by_session_ids[s['session_id']]['ideas'] rescue 0
+ sess = objects_by_session_ids[s['session_id']]
+ if sess.nil?
+ num = 0
+ else
+ num = sess['ideas']
+ end
uploader_distribution[s['content']][num.to_i] +=1
end
[voter_distribution, uploader_distribution]
Please sign in to comment.
Something went wrong with that request. Please try again.