From 5429034f8f3b3dc4a4fd0223ba71fd69e780b500 Mon Sep 17 00:00:00 2001 From: Jared Cosulich Date: Fri, 10 Mar 2017 16:13:30 -0500 Subject: [PATCH] working on twilio integration --- app/controllers/attempts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/attempts_controller.rb b/app/controllers/attempts_controller.rb index f32a54c6..e572f231 100644 --- a/app/controllers/attempts_controller.rb +++ b/app/controllers/attempts_controller.rb @@ -3,7 +3,7 @@ class AttemptsController < ApplicationController protect_from_forgery :except => [:twilio] def twilio - attempt = Attempt.where(from: params['From']).first + attempt = Recipient.where(phone: params['From']).first.attempts.last attempt.update_attributes( answer_index: params[:Body].to_i, twilio_details: params.to_h.to_yaml