Make sure sync() always works with arrays.

This commit is contained in:
Franz Liedke 2012-10-17 18:27:35 +03:00
parent 2e8364994f
commit a6c681db39
1 changed files with 1 additions and 0 deletions

View File

@ -121,6 +121,7 @@ public function detach($ids)
public function sync($ids)
{
$current = $this->pivot()->lists($this->other_key());
$ids = (array) $ids;
// First we need to attach any of the associated models that are not currently
// in the joining table. We'll spin through the given IDs, checking to see