Sha256: 8cb2468239a18924e7a4cc910128cc310f2cf945b4b8a2458f796518f3aa3907
Contents?: true
Size: 721 Bytes
Versions: 37
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true class RenameSshProviderToScript < ActiveRecord::Migration[6.0] def do_change(from, to, from_re, new_label) setting = Setting.find_by(:name => 'remote_execution_form_job_template') default_template = nil Template.where(:provider_type => from).each do |t| default_template = t if t.name == setting&.value t.provider_type = to t.name = t.name.gsub(from_re, new_label) t.save! end if default_template setting.value = default_template.name setting.save! end end def up do_change 'SSH', 'script', /SSH Default$/, 'Script Default' end def down do_change 'script', 'SSH', /Script Default$/, 'SSH Default' end end
Version data entries
37 entries across 37 versions & 1 rubygems