From 609a48b1b1b30e8a87d0066f5fada20279375e05 Mon Sep 17 00:00:00 2001 From: brennen-stripe <86444598+brennen-stripe@users.noreply.github.com> Date: Thu, 16 Feb 2023 07:08:00 -0800 Subject: [PATCH] allowing for AccountId etc (#1009) --- lib/stripe-force/translate/mapper.rb | 2 +- test/unit/test_mapper.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/stripe-force/translate/mapper.rb b/lib/stripe-force/translate/mapper.rb index 376c08694b..39f299a941 100644 --- a/lib/stripe-force/translate/mapper.rb +++ b/lib/stripe-force/translate/mapper.rb @@ -58,7 +58,7 @@ def extract_salesforce_object_field(sf_object, key_path) components.each_with_index do |field_name, i| is_last_component = i == components.size - 1 - normalized_field_name = if !is_last_component && !field_name.end_with?('__c') + normalized_field_name = if !is_last_component && !field_name.end_with?('__c') && !field_name.end_with?('Id') field_name + "Id" else field_name diff --git a/test/unit/test_mapper.rb b/test/unit/test_mapper.rb index e13814e41b..3b7040c1b4 100644 --- a/test/unit/test_mapper.rb +++ b/test/unit/test_mapper.rb @@ -83,6 +83,7 @@ class MapperTest < Critic::UnitTest "subscription_schedule" => { 'metadata.field_custom' => 'CustomField__c', 'metadata.second_custom' => 'CustomField__c', + 'metadata.third_custom' => 'AccountId.Id', 'default_settings.automatic_tax' => 'TaxBoolean__c', }, }