diff --git a/app/models/attempt.rb b/app/models/attempt.rb index 9d87ac7a..4b7e0fe4 100644 --- a/app/models/attempt.rb +++ b/app/models/attempt.rb @@ -19,8 +19,10 @@ class Attempt < ApplicationRecord puts message.inspect puts message.try(:path) + puts message.try(:sid) + # message.path.split('/').last - update_attributes(sent_at: Time.new, twilio_sid: message.path.split('/').last) + update_attributes(sent_at: Time.new, twilio_sid: message.sid) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e7981701..b7116317 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -119,7 +119,7 @@ class FakeSMS def create(from:, to:, body:) self.class.messages << Message.new(from, to, body) - return Struct.new(:path).new('/path') + return Struct.new(:sid).new('sid') end end