Class: Gitlab::BackgroundMigration::FixProjectsWithoutPrometheusService::Migratable::PrometheusService
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Gitlab::BackgroundMigration::FixProjectsWithoutPrometheusService::Migratable::PrometheusService
- Defined in:
- lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb
Overview
Migration model namespace isolated from application code.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.template ⇒ Object
71 72 73 |
# File 'lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb', line 71 def self.template find_by(template: true) end |
.type ⇒ Object
67 68 69 |
# File 'lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb', line 67 def self.type 'PrometheusService' end |
.values ⇒ Object
75 76 77 |
# File 'lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb', line 75 def self.values (template&.attributes_for_insert || DEFAULTS).merge('template' => false, 'active' => true).values end |
Instance Method Details
#attributes_for_insert ⇒ Object
79 80 81 82 83 |
# File 'lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb', line 79 def attributes_for_insert slice(DEFAULTS.keys).transform_values do |v| v.is_a?(String) ? "'#{v}'" : v end end |