Skip to content

Commit

Permalink
Fixing status value check in MongoDb::create() for compatibility wi…
Browse files Browse the repository at this point in the history
…th MongoDB 1.5.
  • Loading branch information
nateabele committed Jun 18, 2010
1 parent 8acbe27 commit 1540b69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/lithium/data/source/MongoDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function create($query, array $options = array()) {
$params = $query->export($self);
$result = $self->connection->{$params['source']}->insert($data, true);

if (isset($result['ok']) && $result['ok'] === 1.0) {
if (isset($result['ok']) && (bool) $result['ok'] === true) {
$id = $data['_id'];
$query->entity()->update(is_object($id) ? $id->__toString() : null);
return true;
Expand Down Expand Up @@ -517,7 +517,7 @@ public function result($type, $resource, $context) {
}

/**
* Formats `group` clauses fro MongoDB.
* Formats `group` clauses for MongoDB.
*
* @param string|array $group The group clause.
* @param object $context
Expand Down

0 comments on commit 1540b69

Please sign in to comment.