Fix has_and_belongs_to_many eager loading initialization bug.
This commit is contained in:
parent
17cc50375b
commit
dd729886f5
|
@ -87,7 +87,7 @@ private static function eagerly($eloquent, &$parents, $include)
|
||||||
// are initialized to an array and "one" relationships are initialized to null.
|
// are initialized to an array and "one" relationships are initialized to null.
|
||||||
foreach ($parents as &$parent)
|
foreach ($parents as &$parent)
|
||||||
{
|
{
|
||||||
$parent->ignore[$include] = (strpos($eloquent->relating, 'has_many') === 0) ? array() : null;
|
$parent->ignore[$include] = (in_array($eloquent->relating, array('has_many', 'has_and_belongs_to_many'))) ? array() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($eloquent->relating == 'has_one')
|
if ($eloquent->relating == 'has_one')
|
||||||
|
|
Loading…
Reference in New Issue