Sha256: e91934dd1baaab72a1aa19ffb6bb035ed70a65e7d5768fd611f24f3715714c4f
Contents?: true
Size: 509 Bytes
Versions: 35
Compression:
Stored size: 509 Bytes
Contents
# frozen_string_literal: true class RemoveDuplicateBootdiskTemplates < ActiveRecord::Migration[4.2] def up template_names = ['Boot disk iPXE - host', 'Boot disk iPXE - generic host'] template_names.each do |template_name| duplicate_template_ids = ProvisioningTemplate.unscoped.where(name: template_name, locked: true).order(created_at: :asc).pluck(:id).drop(1) ProvisioningTemplate.unscoped.where(id: duplicate_template_ids).destroy_all if duplicate_template_ids.any? end end end
Version data entries
35 entries across 35 versions & 1 rubygems