Added related model updating from belongs_to relationship.

This commit is contained in:
Taylor Otwell
2012-03-17 23:14:01 -05:00
parent 68b4e55336
commit fcff36a0ac
4 changed files with 42 additions and 5 deletions

View File

@@ -114,7 +114,9 @@ class Has_Many_And_Belongs_To extends Relationship {
*/
public function delete()
{
return $this->joining_table()->where($this->foreign_key(), '=', $this->base->get_key())->delete();
$id = $this->base->get_key();
return $this->joining_table()->where($this->foreign_key(), '=', $id)->delete();
}
/**