fix(voice): guarantee conference_sid at TwiML render, consistent Call factory

- conference_twiml now ensures call.conference_sid is present before
  rendering; backfills via Voice::Conference::Name.for(call) if missing.
  Prevents invalid TwiML on Call rows created without the sid set.
- Call factory derives account/inbox/contact from the associated
  conversation so create(:call) is always internally consistent (no more
  mismatched account_id across associations).
This commit is contained in:
Muhsin
2026-04-18 10:37:47 +04:00
parent 081e578a57
commit 117742a779
2 changed files with 13 additions and 4 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
FactoryBot.define do
factory :call do
association :account
association :inbox
association :conversation
association :contact
account { conversation.account }
inbox { conversation.inbox }
contact { conversation.contact }
provider { :twilio }
direction { :incoming }
status { 'ringing' }