Fixed bug with commit() when no original record is set (in the case that you are running an update but did not pull the row beforehand).

This commit is contained in:
Josh Sherman 2011-05-14 16:41:08 -04:00
parent ccf728605d
commit 2ea8e1957d

View file

@ -870,7 +870,7 @@ class Model extends Object
$input_parameters = null;
// Limits the columns being updated
$record = ($update === true ? array_diff_assoc($this->record, $this->original[$this->index]) : $this->record);
$record = ($update === true ? array_diff_assoc($this->record, isset($this->original[$this->index]) ? $this->original[$this->index] : array()) : $this->record);
// Makes sure there's something to INSERT or UPDATE
if (count($record) > 0)