Support `#last` on relations with keyset order
When a relation has a complex order clause, ActiveRecord cannot reverse it automatically. But when the order clause is built using Gitlab::Pagination::Keyset::Order, we can determine the reverse order because we pass it in explicitly in these cases. This patch allows ActiveRecord to use the specified reverse order when calling `#last` and other related methods that need a reverse order.
显示
- config/initializers/active_record_keyset_pagination.rb 26 个添加, 0 个删除config/initializers/active_record_keyset_pagination.rb
- lib/gitlab/graphql/pagination/keyset/connection.rb 1 个添加, 1 个删除lib/gitlab/graphql/pagination/keyset/connection.rb
- lib/gitlab/graphql/pagination/keyset/last_items.rb 0 个添加, 25 个删除lib/gitlab/graphql/pagination/keyset/last_items.rb
- spec/lib/gitlab/graphql/pagination/keyset/last_items_spec.rb 0 个添加, 27 个删除spec/lib/gitlab/graphql/pagination/keyset/last_items_spec.rb
想要评论请 注册 或 登录