withDeferred() will add constraints for us

This commit is contained in:
Samuel Georges 2015-01-25 13:02:28 +11:00
parent b58666b4a0
commit e4d4a29bdd
1 changed files with 3 additions and 3 deletions

View File

@ -928,12 +928,12 @@ class RelationController extends ControllerBehavior
$this->controller->relationExtendQuery($query, $this->field);
$this->relationObject->setQuery($query);
if ($this->model->exists) {
$this->relationObject->addConstraints();
}
if ($sessionKey = $this->relationGetSessionKey()) {
$this->relationObject->withDeferred($sessionKey);
}
elseif ($this->model->exists) {
$this->relationObject->addConstraints();
}
});
/*