From 263153dd2c6f285ad8687db411526df8d5e0eae0 Mon Sep 17 00:00:00 2001 From: Charles Fries Date: Sat, 4 Jun 2022 16:00:05 -0700 Subject: [PATCH] fix: use serialized key name when finding included records --- addon/serializers/supabase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/serializers/supabase.ts b/addon/serializers/supabase.ts index c5dadee..f2cd36f 100644 --- a/addon/serializers/supabase.ts +++ b/addon/serializers/supabase.ts @@ -112,7 +112,7 @@ export default class SupabaseSerializer extends RESTSerializer { record: Record ): void { primaryModelClass.eachRelationship((name, { kind, type }) => { - const value = record[name] as RelationshipValue; + const value = record[this.keyForAttribute(name)] as RelationshipValue; if (value && typeof value === 'object') { const includedType = pluralize(type); if (!Array.isArray(payload[includedType])) {