Browse Source

Merge pull request #1276 from rk/rk-issue-1261

[#1261] get_key now pulls from $original instead
Taylor Otwell 12 years ago
parent
commit
5a1741e9d5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      laravel/database/eloquent/model.php

+ 2 - 2
laravel/database/eloquent/model.php

@@ -544,7 +544,7 @@ abstract class Model {
 	 */
 	public function get_key()
 	{
-		return $this->get_attribute(static::$key);
+		return array_get($this->original, static::$key);
 	}
 
 	/**
@@ -721,7 +721,7 @@ abstract class Model {
 		{
 			if (array_key_exists($key, $this->$source)) return true;
 		}
-		
+
 		if (method_exists($this, $key)) return true;
 	}