Skip to content

Commit

Permalink
1.3.1 fix down method
Browse files Browse the repository at this point in the history
  • Loading branch information
adammatysiak committed Jan 2, 2018
1 parent a5110cf commit e55ab86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ This static method will recalculate sequence attributes for every record for thi
Changelog
---------

1.3.1
- fix `down` method when used on object with sequence attribute > 2 (bug introduced in 1.3.0)

1.3.0
- fix `up` method when used on object with sequence attribute > 2

Expand Down
2 changes: 1 addition & 1 deletion src/SequenceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private function getNearObject($earlier)
$condition = $earlier ? '<' : '>';

return $query->where($this->getSequenceConfig('fieldName'), $condition, $currentSequence)
->sequenced('desc')
->sequenced($earlier ? 'desc' : 'asc')
->first();
}

Expand Down

0 comments on commit e55ab86

Please sign in to comment.