Sha256: 3376a985fab156eaa660ee44026d627987c3126bb3ed84b31677741a90ff109f

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

class DisownForemanTemplates < ActiveRecord::Migration
  class FakeConfigTemplate < ActiveRecord::Base
    self.table_name = 'config_templates'
  end

  def up
    update_templates_attributes :locked => false, :vendor => nil
  end

  def down
    update_templates_attributes :locked => true, :vendor => 'Katello'
  end

  private

  def update_templates_attributes(attribute_hash)
    templates = ["puppet.conf", "freeipa_register", "Kickstart default iPXE", "Kickstart default PXELinux", "PXELinux global default"]

    templates.each do |template|
      if (template = FakeConfigTemplate.find_by_name(template))
        template.update_attributes(attribute_hash)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
katello-2.4.0.rc3 db/migrate/20141209103005_disown_foreman_templates.rb
katello-2.4.0.rc2 db/migrate/20141209103005_disown_foreman_templates.rb
katello-2.4.0.rc1 db/migrate/20141209103005_disown_foreman_templates.rb