Commit 9c359d14 by Alexander Makarov

Fixed table name regression caused by changed introduced in #4971

parent 5ac1d67a
...@@ -4,7 +4,7 @@ Yii Framework 2 gii extension Change Log ...@@ -4,7 +4,7 @@ Yii Framework 2 gii extension Change Log
2.0.0 under development 2.0.0 under development
----------------------- -----------------------
- no changes in this release. - Bug: Fixed table name regression caused by changed introduced in #4971 (samdark)
2.0.0-rc September 27, 2014 2.0.0-rc September 27, 2014
......
...@@ -354,7 +354,7 @@ class Generator extends \yii\gii\Generator ...@@ -354,7 +354,7 @@ class Generator extends \yii\gii\Generator
$viaLink = $this->generateRelationLink([$table->primaryKey[0] => $fks[$table->primaryKey[0]][1]]); $viaLink = $this->generateRelationLink([$table->primaryKey[0] => $fks[$table->primaryKey[0]][1]]);
$relationName = $this->generateRelationName($relations, $className0, $db->getTableSchema($table0), $table->primaryKey[1], true); $relationName = $this->generateRelationName($relations, $className0, $db->getTableSchema($table0), $table->primaryKey[1], true);
$relations[$className0][$relationName] = [ $relations[$className0][$relationName] = [
"return \$this->hasMany($className1::className(), $link)->viaTable('{" . $this->generateTableName($table->name) . "}', $viaLink);", "return \$this->hasMany($className1::className(), $link)->viaTable('" . $this->generateTableName($table->name) . "', $viaLink);",
$className1, $className1,
true, true,
]; ];
...@@ -363,7 +363,7 @@ class Generator extends \yii\gii\Generator ...@@ -363,7 +363,7 @@ class Generator extends \yii\gii\Generator
$viaLink = $this->generateRelationLink([$table->primaryKey[1] => $fks[$table->primaryKey[1]][1]]); $viaLink = $this->generateRelationLink([$table->primaryKey[1] => $fks[$table->primaryKey[1]][1]]);
$relationName = $this->generateRelationName($relations, $className1, $db->getTableSchema($table1), $table->primaryKey[0], true); $relationName = $this->generateRelationName($relations, $className1, $db->getTableSchema($table1), $table->primaryKey[0], true);
$relations[$className1][$relationName] = [ $relations[$className1][$relationName] = [
"return \$this->hasMany($className0::className(), $link)->viaTable('{" . $this->generateTableName($table->name) . "}', $viaLink);", "return \$this->hasMany($className0::className(), $link)->viaTable('" . $this->generateTableName($table->name) . "', $viaLink);",
$className0, $className0,
true, true,
]; ];
......
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