diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 15:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-04 15:09:00 +0300 |
commit | 88a0824944720b6edaaef56376713541b9a02118 (patch) | |
tree | f5fcc4f9755f249779cda9a8f02902d734af6e7e /app/models | |
parent | 7d19df2d34a9803d9f077c16315ba919b7ae2aa2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/issue.rb | 14 | ||||
-rw-r--r-- | app/models/pool_repository.rb | 4 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/models/storage/hashed.rb (renamed from app/models/storage/hashed_project.rb) | 2 |
4 files changed, 18 insertions, 4 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 3823b5e0fba..fd4a8c90386 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -147,6 +147,20 @@ class Issue < ApplicationRecord 'project_id' end + def self.simple_sorts + super.merge( + { + 'closest_future_date' => -> { order_closest_future_date }, + 'closest_future_date_asc' => -> { order_closest_future_date }, + 'due_date' => -> { order_due_date_asc.with_order_id_desc }, + 'due_date_asc' => -> { order_due_date_asc.with_order_id_desc }, + 'due_date_desc' => -> { order_due_date_desc.with_order_id_desc }, + 'relative_position' => -> { order_relative_position_asc.with_order_id_desc }, + 'relative_position_asc' => -> { order_relative_position_asc.with_order_id_desc } + } + ) + end + def self.sort_by_attribute(method, excluded_labels: []) case method.to_s when 'closest_future_date', 'closest_future_date_asc' then order_closest_future_date diff --git a/app/models/pool_repository.rb b/app/models/pool_repository.rb index 25eab6e4e03..94992adfd1e 100644 --- a/app/models/pool_repository.rb +++ b/app/models/pool_repository.rb @@ -110,8 +110,8 @@ class PoolRepository < ApplicationRecord end def storage - Storage::HashedProject - .new(self, prefix: Storage::HashedProject::POOL_PATH_PREFIX) + Storage::Hashed + .new(self, prefix: Storage::Hashed::POOL_PATH_PREFIX) end end diff --git a/app/models/project.rb b/app/models/project.rb index 064c647ac59..54bed41e9e7 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -2288,7 +2288,7 @@ class Project < ApplicationRecord def storage @storage ||= if hashed_storage?(:repository) - Storage::HashedProject.new(self) + Storage::Hashed.new(self) else Storage::LegacyProject.new(self) end diff --git a/app/models/storage/hashed_project.rb b/app/models/storage/hashed.rb index 9a38b06b2f9..898e75194db 100644 --- a/app/models/storage/hashed_project.rb +++ b/app/models/storage/hashed.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Storage - class HashedProject + class Hashed attr_accessor :project delegate :gitlab_shell, :repository_storage, to: :project |