Browse Source

fixed bug in eloquent causing ids to overlap.

Taylor Otwell 12 years ago
parent
commit
6904cf119d
2 changed files with 6 additions and 8 deletions
  1. 1 1
      public/index.php
  2. 5 7
      system/db/eloquent/model.php

+ 1 - 1
public/index.php

@@ -3,7 +3,7 @@
  * Laravel - A clean and classy framework for PHP web development.
  *
  * @package  Laravel
- * @version  1.5.8
+ * @version  1.5.9
  * @author   Taylor Otwell
  * @link     http://laravel.com
  */

+ 5 - 7
system/db/eloquent/model.php

@@ -194,10 +194,8 @@ abstract class Model {
 	 *
 	 * @return array
 	 */
-	private function _get($columns = array('*'))
+	private function _get()
 	{
-		$this->query->select($columns);
-
 		return Hydrator::hydrate($this);
 	}
 
@@ -206,9 +204,9 @@ abstract class Model {
 	 *
 	 * @return mixed
 	 */
-	private function _first($columns = array('*'))
+	private function _first()
 	{
-		return (count($results = $this->take(1)->_get($columns)) > 0) ? reset($results) : null;
+		return (count($results = $this->take(1)->_get()) > 0) ? reset($results) : null;
 	}
 
 	/**
@@ -217,7 +215,7 @@ abstract class Model {
 	 * @param  int        $per_page
 	 * @return Paginator
 	 */
-	private function _paginate($per_page = null, $columns = array('*'))
+	private function _paginate($per_page = null)
 	{
 		$total = $this->query->count();
 
@@ -226,7 +224,7 @@ abstract class Model {
 			$per_page = (property_exists(get_class($this), 'per_page')) ? static::$per_page : 20;
 		}
 
-		return Paginator::make($this->select($columns)->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page);
+		return Paginator::make($this->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page);
 	}
 
 	/**