From 858326c0749583b18cc957d108ddc11d1751995b Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 24 Nov 2013 11:51:55 -0500 Subject: [PATCH] Fixed test break. --- framework/yii/base/Model.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/yii/base/Model.php b/framework/yii/base/Model.php index 50032ee..502f696 100644 --- a/framework/yii/base/Model.php +++ b/framework/yii/base/Model.php @@ -220,6 +220,11 @@ class Model extends Component implements IteratorAggregate, ArrayAccess $scenarios[$scenario] = array_keys($attributes); } } + + if (empty($scenarios[self::DEFAULT_SCENARIO])) { + // keep the default scenario so that models without any rules defined can work properly + $scenarios[self::DEFAULT_SCENARIO] = []; + } return $scenarios; }