Browse Source

Fix rules generator

tags/2.0.0-beta
slavcodev 11 years ago
parent
commit
3cdd78cafe
  1. 4
      extensions/gii/generators/model/Generator.php

4
extensions/gii/generators/model/Generator.php

@ -237,10 +237,10 @@ class Generator extends \yii\gii\Generator
$rules = [];
foreach ($types as $type => $columns) {
$rules[] = "['" . implode(', ', $columns) . "', '$type']";
$rules[] = "[['" . implode(', ', $columns) . "'], '$type']";
}
foreach ($lengths as $length => $columns) {
$rules[] = "['" . implode(', ', $columns) . "', 'string', 'max' => $length]";
$rules[] = "[['" . implode(', ', $columns) . "'], 'string', 'max' => $length]";
}
return $rules;

Loading…
Cancel
Save