Fixing bugs in Eq2.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
Taylor Otwell
2012-03-16 10:29:43 -05:00
parent e857505e35
commit c9c0ddf569
5 changed files with 36 additions and 9 deletions

View File

@@ -76,7 +76,7 @@ class Query {
{
// If the relationship is nested, we will skip laoding it here and let
// the load method parse and set the nested eager loads on the right
// relationship when it is getting ready to eager laod it.
// relationship when it is getting ready to eager laod.
if (str_contains($relationship, '.'))
{
continue;
@@ -86,6 +86,14 @@ class Query {
}
}
// The many to many relationships may have pivot table column on them
// so we will call the "clean" method on the relationship to remove
// any pivot columns that are on the model.
if ($this instanceof Relationships\Has_Many_And_Belongs_To)
{
$this->clean($results);
}
return $results;
}