Commit b95dbb15 authored by Jens Segers's avatar Jens Segers

Merge pull request #136 from neoxia/master-fix-breaking-tests

Fix broken tests and a bug about relations
parents 5d3343b3 10c6a9cd
......@@ -191,9 +191,7 @@ abstract class Model extends \Illuminate\Database\Eloquent\Model {
// title of this relation since that is a great convention to apply.
if (is_null($relation))
{
$caller = $this->getBelongsToManyCaller();
$name = $caller['function'];
$relation = $this->getBelongsToManyCaller();
}
// First, we'll need to determine the foreign key and "other key" for the
......
......@@ -68,7 +68,7 @@ class RelationsTest extends PHPUnit_Framework_TestCase {
Item::create(array('type' => 'sword', 'user_id' => $user->_id));
Item::create(array('type' => 'bag', 'user_id' => null));
$items = Item::with('user')->get();
$items = Item::with('user')->orderBy('user_id', 'desc')->get();
$user = $items[0]->getRelation('user');
$this->assertInstanceOf('User', $user);
......
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