gitlab-org--gitlab-foss/spec/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_spec.rb UI and copywriting improvements 2016-06-14 13:18:14 +02:00
awardable_spec.rb Fix rubocop offense in awardable specs 2016-06-06 07:42:12 +02:00
case_sensitivity_spec.rb trick rubocop and temporarily add ruby 2.1 images for any branch 2016-01-28 11:41:58 +01:00
issuable_spec.rb Fix pagination on sorts with lots of ties 2016-06-23 15:26:50 +01:00
mentionable_spec.rb Restrict access to references for confidential issues 2016-03-17 20:55:59 -03:00
milestoneish_spec.rb Project members with guest role can't access confidential issues 2016-06-13 19:32:00 -03:00
participable_spec.rb Cache Participable#participants in instance variable 2016-06-21 12:54:12 +02:00
statuseable_spec.rb Render canceled status if any of the jobs canceled 2016-04-27 14:16:01 +02:00
strip_attribute_spec.rb Strip attributes for Milestone and Issuable. #3428 2015-11-26 10:16:50 -05:00
subscribable_spec.rb Add API endpoints for un/subscribing from/to a label 2016-05-12 22:48:09 +02:00
token_authenticatable_spec.rb Enable RSpec/NotToNot cop and auto-correct offenses 2016-05-24 15:40:29 -04:00