From 6023c0285b044c771014d5ce1d24c277877a15d2 Mon Sep 17 00:00:00 2001 From: loek17 Date: Tue, 30 Dec 2014 18:12:53 +0100 Subject: [PATCH] getForeignKey function doesn't work correct Get the primaryKey from the foreign model instead of the primaryKey from current model --- src/Rel/BelongsTo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rel/BelongsTo.php b/src/Rel/BelongsTo.php index 3862213..152f2e7 100644 --- a/src/Rel/BelongsTo.php +++ b/src/Rel/BelongsTo.php @@ -53,7 +53,7 @@ public function getKey() */ public function getForeignKey() { - return $this->getConfig()->getPrimaryKey(); + return $this->getRepo()->getConfig()->getPrimaryKey(); } /**