diff options
Diffstat (limited to 'app/models/packages/composer/cache_file.rb')
-rw-r--r-- | app/models/packages/composer/cache_file.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/packages/composer/cache_file.rb b/app/models/packages/composer/cache_file.rb index ecd7596b989..5222101d171 100644 --- a/app/models/packages/composer/cache_file.rb +++ b/app/models/packages/composer/cache_file.rb @@ -9,15 +9,13 @@ module Packages mount_file_store_uploader Packages::Composer::CacheUploader - belongs_to :group, -> { where(type: 'Group') }, foreign_key: 'namespace_id' + belongs_to :group, -> { where(type: Group.sti_name) }, foreign_key: 'namespace_id' belongs_to :namespace validates :namespace, presence: true scope :with_namespace, ->(namespace) { where(namespace: namespace) } scope :with_sha, ->(sha) { where(file_sha256: sha) } - scope :expired, -> { where("delete_at <= ?", Time.current) } - scope :without_namespace, -> { where(namespace_id: nil) } end end end |