Skip to content

Commit

Permalink
getRelatedIds -> allRelatedIds
Browse files Browse the repository at this point in the history
Create a running document of breaking changes
  • Loading branch information
daftspunk committed May 12, 2017
1 parent 5f2f913 commit bc23bc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
Changelog can be found here: http://octobercms.com/changelog

### Breaking changes Laravel 5.5

- Database queries now return Collections instead of arrays!
- `pluck()` should be renamed to `value()`
- `getRelatedIds()` called from BelongsToMany is renamed to `allRelatedIds()`
- `Mail::pretend()` has been removed, use `Config::set('mail.driver', 'log');` instead


4 changes: 3 additions & 1 deletion tests/unit/plugins/database/BelongsToManyModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testDeferredBinding()
$this->assertEquals([$role1->id, $role2->id], $author->getRelationValue('roles'));

// Get simple value (explicit)
$relatedIds = $author->roles()->getRelatedIds($sessionKey);
$relatedIds = $author->roles()->allRelatedIds($sessionKey)->all();
$this->assertEquals([$role1->id, $role2->id], $relatedIds);

// Commit deferred
Expand Down Expand Up @@ -162,5 +162,7 @@ public function testConditionsWithPivotAttributes()
$author->roles()->add($role3, null, ['is_executive' => 0]);

$this->assertEquals([1, 2], $author->executive_authors->lists('id'));
$this->assertEquals([1, 2], $author->executive_authors()->lists('id'));
$this->assertEquals([1, 2], $author->executive_authors()->get()->lists('id'));
}
}

0 comments on commit bc23bc8

Please sign in to comment.