From 1847a369fb35143b3db49038e3a0eaa141d8186a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 11 Apr 2012 16:08:15 -0500 Subject: [PATCH] fixed eloquent datetime bug when determining dirty attributes. --- laravel/database/eloquent/model.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 2539d50d..4fe8ef86 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -472,7 +472,17 @@ public function table() */ 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; } /**