Skip to content

Commit

Permalink
adding an extra check to only type cast if its a int/true/false so yo…
Browse files Browse the repository at this point in the history
…u can still use fields etc in the queries
  • Loading branch information
dogmatic69 authored and markstory committed Mar 24, 2012
1 parent a568594 commit 7c697eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -1836,7 +1836,7 @@ protected function _prepareUpdateFields(Model $model, $fields, $quoteValues = tr

if ($quoteValues) {
$update .= $this->value($value, $model->getColumnType($field));
} elseif ($model->getColumnType($field) == 'boolean') {
} elseif ($model->getColumnType($field) == 'boolean' && (is_int($value) || is_bool($value))) {
$update .= $this->boolean($value, true);
} elseif (!$alias) {
$update .= str_replace($quotedAlias . '.', '', str_replace(
Expand Down

0 comments on commit 7c697eb

Please sign in to comment.