diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-08 15:12:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-08 15:12:41 +0300 |
commit | 8fea353b907d1fd571f5450a757cafee73cfbfd0 (patch) | |
tree | 38cd1edddd3de94d6f743029c164fab5691a7241 /app/models/namespace.rb | |
parent | db5097a28b061ef273a058aa64845c79635ea4e7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index d519ceb658d..4f0639a08a0 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -176,10 +176,12 @@ class Namespace < ApplicationRecord end scope :sorted_by_similarity_and_parent_id_desc, -> (search) do - order_expression = Gitlab::Database::SimilarityScore.build_expression(search: search, rules: [ - { column: arel_table["path"], multiplier: 1 }, - { column: arel_table["name"], multiplier: 0.7 } - ]) + order_expression = Gitlab::Database::SimilarityScore.build_expression( + search: search, + rules: [ + { column: arel_table["path"], multiplier: 1 }, + { column: arel_table["name"], multiplier: 0.7 } + ]) reorder(order_expression.desc, Namespace.arel_table['parent_id'].desc.nulls_last, Namespace.arel_table['id'].desc) end |