Commit 6904cf11 authored by Taylor Otwell's avatar Taylor Otwell

fixed bug in eloquent causing ids to overlap.

parent 174d50c0
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Laravel - A clean and classy framework for PHP web development. * Laravel - A clean and classy framework for PHP web development.
* *
* @package Laravel * @package Laravel
* @version 1.5.8 * @version 1.5.9
* @author Taylor Otwell * @author Taylor Otwell
* @link http://laravel.com * @link http://laravel.com
*/ */
......
...@@ -194,10 +194,8 @@ abstract class Model { ...@@ -194,10 +194,8 @@ abstract class Model {
* *
* @return array * @return array
*/ */
private function _get($columns = array('*')) private function _get()
{ {
$this->query->select($columns);
return Hydrator::hydrate($this); return Hydrator::hydrate($this);
} }
...@@ -206,9 +204,9 @@ abstract class Model { ...@@ -206,9 +204,9 @@ abstract class Model {
* *
* @return mixed * @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 { ...@@ -217,7 +215,7 @@ abstract class Model {
* @param int $per_page * @param int $per_page
* @return Paginator * @return Paginator
*/ */
private function _paginate($per_page = null, $columns = array('*')) private function _paginate($per_page = null)
{ {
$total = $this->query->count(); $total = $this->query->count();
...@@ -226,7 +224,7 @@ abstract class Model { ...@@ -226,7 +224,7 @@ abstract class Model {
$per_page = (property_exists(get_class($this), 'per_page')) ? static::$per_page : 20; $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);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment