Commit fd2f2448caebb9bd79a3acd7f99ae1c032ebe8e7

Authored by Pius Uzamere
1 parent d30da595

hotfix for question creation with 0 or 1 ideas provided

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/controllers/questions_controller.rb
... ... @@ -15,7 +15,7 @@ class QuestionsController < InheritedResources::Base
15 15 def create
16 16 authenticate
17 17 logger.info "vi is #{params['question']['visitor_identifier']} and local are #{params['question']['local_identifier']}. all params are #{params.inspect}"
18   - if @question = current_user.create_question(params['question']['visitor_identifier'], :name => params['question']['name'], :local_identifier => params['question']['local_identifier'], :ideas => (params['question']['ideas'].lines.to_a) rescue [])
  18 + if @question = current_user.create_question(params['question']['visitor_identifier'], :name => params['question']['name'], :local_identifier => params['question']['local_identifier'], :ideas => begin (params['question']['ideas'].lines.to_a) rescue [] end)
19 19 respond_to do |format|
20 20 format.xml { render :xml => @question.to_xml}
21 21 end
... ...