From 02f1fdf3b6ef65d7db67ad01afb22650baf7736f Mon Sep 17 00:00:00 2001 From: Muhsin <12408980+muhsin-k@users.noreply.github.com> Date: Mon, 20 Apr 2026 14:30:42 +0400 Subject: [PATCH] fix(voice): avoid Jbuilder's reserved `call` keyword in message serializer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jbuilder defines Jbuilder#call(object, *attributes) as its core API for extracting attributes. Using `json.call do ... end` collided with that signature and raised "wrong number of arguments (given 0, expected 1+)". Use `json.set! :call, message.call.push_event_data` instead — also deduplicates the field list between the jbuilder and Message#push_event_data (both now go through Call#push_event_data). --- app/views/api/v1/models/_message.json.jbuilder | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/app/views/api/v1/models/_message.json.jbuilder b/app/views/api/v1/models/_message.json.jbuilder index b6c52a7b9..beded86cd 100644 --- a/app/views/api/v1/models/_message.json.jbuilder +++ b/app/views/api/v1/models/_message.json.jbuilder @@ -14,21 +14,5 @@ json.sender message.sender.push_event_data if message.sender json.attachments message.attachments.map(&:push_event_data) if message.attachments.present? if message.content_type == 'voice_call' && message.respond_to?(:call) && message.call.present? - call = message.call - json.call do - json.id call.id - json.provider_call_id call.provider_call_id - json.provider call.provider - json.direction call.direction - json.status call.display_status - json.duration_seconds call.duration_seconds - json.conference_sid call.conference_sid - json.accepted_by_agent_id call.accepted_by_agent_id - json.started_at call.started_at&.to_i - json.ended_at call.ended_at - json.from_number call.from_number - json.to_number call.to_number - json.recording_url call.recording_url - json.transcript call.transcript - end + json.set! :call, message.call.push_event_data end