Skip to content

Commit 090bcfb

Browse files
authored
Use the field lookup name instead of SObject name (#47)
1 parent a77434c commit 090bcfb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

record.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (r *Record) fromJSONMap(jsonMap map[string]interface{}) {
7575
} else {
7676
if r.isLookUp(obj) {
7777
if rec, err := RecordFromJSONMap(obj); err == nil {
78-
r.lookUps[rec.sobject] = rec
78+
r.lookUps[k] = rec
7979
}
8080
}
8181
}

record_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestRecord_UnmarshalJSON(t *testing.T) {
9494
"Id": "x01D0000000002RIAQ",
9595
},
9696
lookUps: map[string]*Record{
97-
"SomeLookup__c": &Record{
97+
"SomeLookup__r": &Record{
9898
sobject: "SomeLookup__c",
9999
url: "/services/data/v44.0/sobjects/SomeLookup__c/0012E00001q0KijQAE",
100100
fields: map[string]interface{}{

0 commit comments

Comments
 (0)