diff options
author | Nick Thomas <nick@gitlab.com> | 2017-11-28 12:46:39 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-11-28 12:46:39 +0000 |
commit | 0185d7800b23daecd44abe8e9a0b2672a831e8be (patch) | |
tree | af69f53cbc9842246dd5c67f0985aaea69cbc40a /app/models/project.rb | |
parent | 85ff313a1ecf3fc0ffbf1989533d4fa38bd8daf8 (diff) | |
parent | 58f32622ce9c2d08001da7b91065942cdc5a0f4a (diff) | |
download | gitlab-ce-0185d7800b23daecd44abe8e9a0b2672a831e8be.tar.gz |
Merge branch 'hashed-storage-attachments-migration-path' into 'master'
Hashed storage attachments migration path
See merge request gitlab-org/gitlab-ce!15352
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index e276bd2422d..85d580fe0fa 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -273,8 +273,9 @@ class Project < ActiveRecord::Base scope :pending_delete, -> { where(pending_delete: true) } scope :without_deleted, -> { where(pending_delete: false) } - scope :with_hashed_storage, -> { where('storage_version >= 1') } - scope :with_legacy_storage, -> { where(storage_version: [nil, 0]) } + scope :with_storage_feature, ->(feature) { where('storage_version >= :version', version: HASHED_STORAGE_FEATURES[feature]) } + scope :without_storage_feature, ->(feature) { where('storage_version < :version OR storage_version IS NULL', version: HASHED_STORAGE_FEATURES[feature]) } + scope :with_unmigrated_storage, -> { where('storage_version < :version OR storage_version IS NULL', version: LATEST_STORAGE_VERSION) } scope :sorted_by_activity, -> { reorder(last_activity_at: :desc) } scope :sorted_by_stars, -> { reorder('projects.star_count DESC') } |