Fixing a few things in Eloquent 2.

This commit is contained in:
Taylor Otwell
2012-03-22 11:00:13 -05:00
parent 268e6e460d
commit b6615ddbee
2 changed files with 29 additions and 1 deletions

View File

@@ -110,7 +110,7 @@ class Has_Many_And_Belongs_To extends Relationship {
// the developer to not worry about maintaining the join table.
if ($model instanceof Model)
{
$joining = array_merge($this->join_record($id), $joining);
$joining = array_merge($this->join_record($model->get_key()), $joining);
$result = $this->insert_joining($joining);
}