Class: Gitlab::BackgroundMigration::PurgeStaleSecurityScans::SecurityScan
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Gitlab::BackgroundMigration::PurgeStaleSecurityScans::SecurityScan
- Includes:
- EachBatch
- Defined in:
- lib/gitlab/background_migration/purge_stale_security_scans.rb
Overview
rubocop:disable Migration/BackgroundMigrationBaseClass
Constant Summary collapse
- STALE_AFTER =
90.days
Constants inherited from ApplicationRecord
Constants included from ResetOnUnionError
ResetOnUnionError::MAX_RESET_PERIOD
Class Method Summary collapse
Methods inherited from ApplicationRecord
cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
Methods included from SensitiveSerializableHash
Class Method Details
.last_stale_record_id ⇒ Object
22 23 24 |
# File 'lib/gitlab/background_migration/purge_stale_security_scans.rb', line 22 def self.last_stale_record_id where('created_at < ?', STALE_AFTER.ago).order(created_at: :desc).first end |