From 5042ef84cc20260eba87a9028c77f11a0a0304aa Mon Sep 17 00:00:00 2001 From: Pius Uzamere Date: Fri, 15 Jan 2010 11:52:17 -0500 Subject: [PATCH] stop catching errors in idea creation and improve logging --- app/controllers/questions_controller.rb | 2 +- app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index 1d3f433..a5f810c 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -20,7 +20,7 @@ class QuestionsController < InheritedResources::Base def create authenticate logger.info "vi is #{params['question']['visitor_identifier']} and local are #{params['question']['local_identifier']}. all params are #{params.inspect}" - 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.delete_if? {|i| i.blank?}) rescue [] end) + 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.delete_if? {|i| i.blank?})) respond_to do |format| format.xml { render :xml => @question.to_xml} end diff --git a/app/models/user.rb b/app/models/user.rb index 637b8ff..71c84da 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -10,7 +10,7 @@ class User < ActiveRecord::Base end def create_question(visitor_identifier, question_params) - puts "the question_params are #{question_params.inspect}" + logger.info "the question_params are #{question_params.inspect}" visitor = visitors.find_or_create_by_identifier(visitor_identifier) question = visitor.questions.create(question_params.merge(:site => self)) end -- libgit2 0.21.2