Browse files

add default type for voter_map and timeline_graph

  • Loading branch information...
1 parent cf4d1c9 commit abf11fe7d9888e865d35616dd3e646f44b38ef95 @lukebaker lukebaker committed Dec 17, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 app/controllers/questions_controller.rb
View
7 app/controllers/questions_controller.rb
@@ -361,9 +361,10 @@ def word_cloud
def voter_map
logger.info "@question = Question.find_by_name(#{params[:id]}) ..."
- data = Earl.voter_map(params[:id], params[:type])
+ type = params[:type] || 'votes'
+ data = Earl.voter_map(params[:id], type)
- case params[:type]
+ case type
when "votes" then
@object_type = t('common.votes')
when "all_photocracy_votes" then
@@ -683,7 +684,7 @@ def scatter_votes_by_session
def timeline_graph
totals = params[:totals]
- type = params[:type]
+ type = params[:type] || 'votes'
if !totals || totals != "true"
@earl = Earl.find params[:id]

0 comments on commit abf11fe

Please sign in to comment.