diff options
Diffstat (limited to 'app/models/customer_relations/contact.rb')
-rw-r--r-- | app/models/customer_relations/contact.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/app/models/customer_relations/contact.rb b/app/models/customer_relations/contact.rb index ded6ab8687a..0f13c45b84d 100644 --- a/app/models/customer_relations/contact.rb +++ b/app/models/customer_relations/contact.rb @@ -57,7 +57,22 @@ class CustomerRelations::Contact < ApplicationRecord end def self.sort_by_name - order("last_name ASC, first_name ASC") + order(Gitlab::Pagination::Keyset::Order.build([ + Gitlab::Pagination::Keyset::ColumnOrderDefinition.new( + attribute_name: 'last_name', + order_expression: arel_table[:last_name].asc, + distinct: false + ), + Gitlab::Pagination::Keyset::ColumnOrderDefinition.new( + attribute_name: 'first_name', + order_expression: arel_table[:first_name].asc, + distinct: false + ), + Gitlab::Pagination::Keyset::ColumnOrderDefinition.new( + attribute_name: 'id', + order_expression: arel_table[:id].asc + ) + ])) end def self.find_ids_by_emails(group, emails) |