Skip to content

Commit 967f790

Browse files
Merge pull request #29 from Peter-Krebs/master
Model: .for() should use object.getPrimaryKey() instead of object.id
2 parents 4db4836 + 24e6852 commit 967f790

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Model.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default class Model extends StaticModel {
6969
throw new Error('The object referenced on for() method is not a valid Model.')
7070
}
7171

72-
if (!this.isValidId(object.id)) {
72+
if (!this.isValidId(object.getPrimaryKey())) {
7373
throw new Error('The object referenced on for() method has a invalid id.')
7474
}
7575

@@ -294,4 +294,4 @@ export default class Model extends StaticModel {
294294
}).then(response => response)
295295
}
296296

297-
}
297+
}

0 commit comments

Comments
 (0)