Skip to content

Commit

Permalink
allowing for AccountId etc (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
brennen-stripe authored Feb 16, 2023
1 parent a03ccca commit 609a48b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stripe-force/translate/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/unit/test_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
}
Expand Down

0 comments on commit 609a48b

Please sign in to comment.