Skip to content
Snippets Groups Projects

Add and backfill project_id for p_ci_pipeline_variables

Merged Max Orefice requested to merge morefice/add-sharding-key-p-ci-pipeline-variables into master
2 unresolved threads
20 files
+ 249
11
Compare changes
  • Side-by-side
  • Inline
Files
20
@@ -21,9 +21,16 @@ class PipelineVariable < Ci::ApplicationRecord
alias_attribute :secret_value, :value
validates :key, :pipeline, presence: true
before_validation :set_project_id, on: :create
def hook_attrs
{ key: key, value: value }
end
private
def set_project_id
self.project_id ||= pipeline&.project_id
end
end
end
Loading