Skip to content

Commit

Permalink
Merge branch 'release/0.1.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrossi committed May 3, 2017
2 parents bcc2d5d + cb1853a commit 60dfaf2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Field/PostObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function process($fieldName)
$connection = $this->post->getConnectionName();

if (is_array($postId)) {
$this->object = Post::on($connection)->whereIn('ID', $postId)->get();
$this->object = Post::on($connection)->whereIn('ID', $postId)->get()->sortBy(function ($item) use ($postId) {
return array_search($item->getKey(), $postId);
});
} else {
$this->object = Post::on($connection)->find($postId);
}
Expand Down

0 comments on commit 60dfaf2

Please sign in to comment.