Commit f473abe1 by Qiang Xue

Fixes #1405: fixed disambiguation of relation names generated by gii.

parent 7a5a29c7
......@@ -397,10 +397,10 @@ class Generator extends \yii\gii\Generator
}
$name = $rawName = Inflector::id2camel($key, '_');
$i = 0;
while (isset($table->columns[$name])) {
while (isset($table->columns[lcfirst($name)])) {
$name = $rawName . ($i++);
}
while (isset($relations[$className][$name])) {
while (isset($relations[$className][lcfirst($name)])) {
$name = $rawName . ($i++);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment