Skip to content

Commit

Permalink
jpfuentes2GH-68 relationship references wrong table (by jmoberley)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuitad committed Apr 22, 2011
1 parent 812e397 commit 68189f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public function load(Model $model) {
if ($this->through)
{
// verify through is a belongs_to or has_many for access of keys
if (!($through_relationship = $this->get_table()->get_relationship($this->through)))
if (!($through_relationship = $model->table()->get_relationship($this->through)))
throw new HasManyThroughAssociationException("Could not find the association $this->through in model " . get_class($model));

if (!($through_relationship instanceof HasMany) && !($through_relationship instanceof BelongsTo))
Expand Down

0 comments on commit 68189f1

Please sign in to comment.