Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing issue with boolean columns not correctly inserting

data in MySQL.
Fixes #1922
  • Loading branch information...
commit 3bfd81571633b2d781b0aaea64bb128ff6f7231b 1 parent 443ff92
@markstory markstory authored
View
3  cake/console/libs/tasks/fixture.php
@@ -383,6 +383,9 @@ function _getRecordsFromTable($modelName, $useTable = null) {
foreach ($records as $record) {
$row = array();
foreach ($record[$modelObject->alias] as $field => $value) {
+ if ($schema[$field]['type'] === 'boolean') {
+ $value = (int)(bool)$value;
+ }
$row[$field] = $value;
}
$out[] = $row;
View
1  cake/tests/cases/console/libs/tasks/fixture.test.php
@@ -354,6 +354,7 @@ function testRecordGenerationForBinaryAndFloat() {
$result = $this->Task->bake('Article', 'datatypes');
$this->assertPattern("/'float_field' => 1/", $result);
+ $this->assertPattern("/'bool' => 1/", $result);
$result = $this->Task->bake('Article', 'binary_tests');
$this->assertPattern("/'data' => 'Lorem ipsum dolor sit amet'/", $result);
Please sign in to comment.
Something went wrong with that request. Please try again.