Skip to content

Commit

Permalink
Changed Orm\Query::update() to return true when affected rows = 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelmer Schreuder committed May 21, 2011
1 parent e322780 commit 42e17df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion classes/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,6 @@ protected function update()
}

// update the original property on success

$this->observe('after_update');

return true;
Expand Down
3 changes: 2 additions & 1 deletion classes/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,8 @@ public function update()
$this->relations = $tmp_relations;
$this->group_by = $tmp_group_by;

return $res > 0;
// Update can affect 0 rows when input types are different but outcome stays the same
return $res >= 0;
}

/**
Expand Down

0 comments on commit 42e17df

Please sign in to comment.