Browse Source

fix eager loading of belongs_to relationships when all keys are null.

Taylor Otwell 12 years ago
parent
commit
1dea9852a9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      laravel/database/eloquent/relationships/belongs_to.php

+ 2 - 0
laravel/database/eloquent/relationships/belongs_to.php

@@ -71,6 +71,8 @@ class Belongs_To extends Relationship {
 			}
 		}
 
+		if (count($keys) == 0) $keys = array(0);
+
 		$this->table->where_in($this->model->key(), array_unique($keys));
 	}