diff options
Diffstat (limited to 'app/models/packages/nuget/symbol.rb')
-rw-r--r-- | app/models/packages/nuget/symbol.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/packages/nuget/symbol.rb b/app/models/packages/nuget/symbol.rb index 3315f11b974..f15b045f303 100644 --- a/app/models/packages/nuget/symbol.rb +++ b/app/models/packages/nuget/symbol.rb @@ -5,6 +5,10 @@ module Packages class Symbol < ApplicationRecord include FileStoreMounter include ShaAttribute + include Packages::Destructible + + # Used in destroying stale symbols in worker + enum :status, default: 0, processing: 1, error: 3 belongs_to :package, -> { where(package_type: :nuget) }, inverse_of: :nuget_symbols @@ -20,6 +24,12 @@ module Packages before_validation :set_object_storage_key, on: :create + scope :stale, -> { where(package_id: nil) } + scope :pending_destruction, -> { stale.default } + scope :with_file_name, ->(file_name) { where(file: file_name) } + scope :with_signature, ->(signature) { where(signature: signature) } + scope :with_file_sha256, ->(checksums) { where(file_sha256: checksums) } + private def set_object_storage_key |