Browse Source

fixed eloquent datetime bug when determining dirty attributes.

Taylor Otwell 12 years ago
parent
commit
1847a369fb
1 changed files with 11 additions and 1 deletions
  1. 11 1
      laravel/database/eloquent/model.php

+ 11 - 1
laravel/database/eloquent/model.php

@@ -472,7 +472,17 @@ abstract class Model {
 	 */
 	public function get_dirty()
 	{
-		return array_diff_assoc($this->attributes, $this->original);
+		$dirty = array();
+
+		foreach ($this->attributes as $key => $value)
+		{
+			if ( ! isset($this->original[$key]) or $value !== $this->original[$key])
+			{
+				$dirty[$key] = $value;
+			}
+		}
+
+		return $dirty;
 	}
 
 	/**