diff --git a/modules/orm/classes/Kohana/ORM.php b/modules/orm/classes/Kohana/ORM.php index 2c8d9d1..54f3a86 100644 --- a/modules/orm/classes/Kohana/ORM.php +++ b/modules/orm/classes/Kohana/ORM.php @@ -792,6 +792,20 @@ class Kohana_ORM extends Model implements serializable { // Object is no longer saved or valid $this->_saved = $this->_valid = FALSE; } + + // If the replacement value is the same as the original value, we dont need to update. + // @note This assumes that the value returned from the DB is always a string. + if (array_key_exists($column, $this->_original_values) AND (string)$value === $this->_original_values[$column] AND array_key_exists($column, $this->_changed)) + { + unset($this->_changed[$column]); + + // Reset back our saved status. + if (! count($this->_changed)) + { + $this->_saved = $this->_valid = TRUE; + } + } + } elseif (isset($this->_belongs_to[$column])) {