Skip to content

Commit

Permalink
Use the field lookup name instead of SObject name (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
g8rswimmer authored Oct 1, 2019
1 parent a77434c commit 090bcfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion record.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (r *Record) fromJSONMap(jsonMap map[string]interface{}) {
} else {
if r.isLookUp(obj) {
if rec, err := RecordFromJSONMap(obj); err == nil {
r.lookUps[rec.sobject] = rec
r.lookUps[k] = rec
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestRecord_UnmarshalJSON(t *testing.T) {
"Id": "x01D0000000002RIAQ",
},
lookUps: map[string]*Record{
"SomeLookup__c": &Record{
"SomeLookup__r": &Record{
sobject: "SomeLookup__c",
url: "/services/data/v44.0/sobjects/SomeLookup__c/0012E00001q0KijQAE",
fields: map[string]interface{}{
Expand Down

0 comments on commit 090bcfb

Please sign in to comment.