Skip to content

Commit

Permalink
Fixes #333: Fixed incorrect validation rule for TINYINT column type
Browse files Browse the repository at this point in the history
After recent updates to Yii2 Schema, Gii Model started to generate `string` validator rules for `tinyint` column type, where instead it should be `integer` validator as it always was. After these updates my applications started to show validation errors (particularly REST applications, did not test with client-server application).
  • Loading branch information
nostop8 authored and samdark committed Feb 16, 2018
1 parent eff0d4f commit 2ee6efe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Yii Framework 2 gii extension Change Log
2.0.7 under development
-----------------------

- Bug #333: Fixed incorrect validation rule for TINYINT column type (nostop8)
- Bug #328: Fix bug in CRUD update view generator (ricpelo)


Expand Down
1 change: 1 addition & 0 deletions generators/model/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public function generateRules($table)
case Schema::TYPE_SMALLINT:
case Schema::TYPE_INTEGER:
case Schema::TYPE_BIGINT:
case Schema::TYPE_TINYINT:
$types['integer'][] = $column->name;
break;
case Schema::TYPE_BOOLEAN:
Expand Down

0 comments on commit 2ee6efe

Please sign in to comment.