From 5a703b7ae13731529e1707722af581a1741d7934 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 7 Jan 2014 10:06:20 -0500 Subject: [PATCH] Further cleanup. --- framework/yii/db/ActiveQuery.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/yii/db/ActiveQuery.php b/framework/yii/db/ActiveQuery.php index 65e5fe9..8ae6c4a 100644 --- a/framework/yii/db/ActiveQuery.php +++ b/framework/yii/db/ActiveQuery.php @@ -251,10 +251,10 @@ class ActiveQuery extends Query implements ActiveQueryInterface $this->with = []; foreach ($with as $name => $value) { if (is_integer($name)) { - if (!in_array($value, $this->with, true) && !isset($this->with[$value])) { - $this->with[] = $value; - } + // repeating relation is fine as ActiveQueryTrait::normalizeRelations() handle it well + $this->with[] = $value; } elseif (!isset($this->with[$name])) { + // with() takes precedence over joinWith() when both specify the same relation with callback $this->with[$name] = $value; } }