gitlab-org--gitlab-foss/app/models/concerns
Sean McGivern d7a5a28c53 Fix pagination on sorts with lots of ties
Postgres and MySQL don't guarantee that pagination with `LIMIT` and
`OFFSET` will work if the ordering isn't unique. From the Postgres docs:

> When using `LIMIT`, it is important to use an `ORDER BY` clause that
> constrains the result rows into a unique order. Otherwise you will get
> an unpredictable subset of the query's rows

Before:

    [1] pry(main)> issues = 1.upto(Issue.count).map { |i| Issue.sort('priority').page(i).per(1).map(&:id) }.flatten
    [2] pry(main)> issues.count
    => 81
    [3] pry(main)> issues.uniq.count
    => 42

After:

    [1] pry(main)> issues = 1.upto(Issue.count).map { |i| Issue.sort('priority').page(i).per(1).map(&:id) }.flatten
    [2] pry(main)> issues.count
    => 81
    [3] pry(main)> issues.uniq.count
    => 81
2016-06-23 15:26:50 +01:00
..
access_requestable.rb UI and copywriting improvements 2016-06-14 13:18:14 +02:00
awardable.rb Include user relationship when retrieving award_emoji 2016-06-15 06:50:12 +02:00
case_sensitivity.rb Revamp finding projects by namespaces 2015-10-08 14:35:32 +02:00
importable.rb started refactoring some stuff based on MR feedback 2016-06-01 18:03:51 +02:00
internal_id.rb Use GitHub Issue/PR number as iid to keep references 2016-04-18 12:15:50 -03:00
issuable.rb Fix pagination on sorts with lots of ties 2016-06-23 15:26:50 +01:00
mentionable.rb Refactor Mentionable 2016-05-26 17:14:07 +02:00
milestoneish.rb Use a better message when milestone is newly created 2016-04-29 10:15:49 +01:00
participable.rb Cache Participable#participants in instance variable 2016-06-21 12:54:12 +02:00
referable.rb Fix RangeError exceptions when referring to issues or merge requests outside of max database values 2016-06-18 13:07:38 -07:00
sortable.rb Sort by ID when sorting using "Recently created" 2016-01-07 14:53:02 +01:00
statuseable.rb Render canceled status if any of the jobs canceled 2016-04-27 14:16:01 +02:00
strip_attribute.rb Strip attributes for Milestone and Issuable. #3428 2015-11-26 10:16:50 -05:00
subscribable.rb Add API endpoints for un/subscribing from/to a label 2016-05-12 22:48:09 +02:00
taskable.rb Fix bug that happened when replacing the Task list. #2296 2015-11-20 13:58:45 -05:00
token_authenticatable.rb Use method that creates runners registration token 2015-12-23 11:45:17 +01:00