Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #575 from dimsav/issue-294
Browse files Browse the repository at this point in the history
normalize foreign key
  • Loading branch information
Gummibeer committed Jun 3, 2019
2 parents bf40613 + e70bbea commit de9f536
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Translatable/Translatable.php
Expand Up @@ -134,14 +134,10 @@ public function getTranslationModelNamespace()
public function getRelationKey()
{
if ($this->translationForeignKey) {
$key = $this->translationForeignKey;
} elseif ($this->primaryKey !== 'id') {
$key = $this->primaryKey;
} else {
$key = $this->getForeignKey();
return $this->translationForeignKey;
}

return $key;
return $this->getForeignKey();
}

/**
Expand Down

0 comments on commit de9f536

Please sign in to comment.