Don't imply order on posts relationship

This commit is contained in:
Toby Zerner 2015-02-10 17:53:16 +10:30
parent ebd22d22f5
commit 0edfeb5031
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ class DiscussionSerializer extends DiscussionBasicSerializer
*/ */
public function linkPosts(Discussion $discussion) public function linkPosts(Discussion $discussion)
{ {
return (new PostBasicSerializer)->collection($discussion->posts()->whereCanView()->ids()); return (new PostBasicSerializer)->collection($discussion->posts()->whereCanView()->orderBy('time', 'asc')->ids());
} }
/** /**

View File

@ -106,7 +106,7 @@ class Discussion extends Entity
public function posts() public function posts()
{ {
return $this->hasMany('Flarum\Core\Posts\Post')->orderBy('time', 'asc'); return $this->hasMany('Flarum\Core\Posts\Post');
} }
public function comments() public function comments()