OSDN Git Service

Добавлен тест модели типов.
[invent/invent.git] / models / Types.php
index c38d23d..dce3125 100644 (file)
@@ -34,7 +34,9 @@ class Types extends \yii\db\ActiveRecord
     public function rules()
     {
         return [
-            [['name'], 'string', 'max' => 100],
+            [[ 'id' ], 'integer' ],
+            [[ 'name' ], 'string', 'max' => 100, ],
+            [[ 'name' ], 'required' ],
         ];
     }