Sha256: 2e88fe5e8cdf9439e7acb263a4626639ff19802f53eb151a0770ce6d65a536cb
Contents?: true
Size: 1.29 KB
Versions: 12
Compression:
Stored size: 1.29 KB
Contents
# This migration comes from knitkit (originally 20120127150506) class AddPrimaryHostToWebsiteConfiguration def self.up unless ConfigurationItemType.find_by_internal_identifier('primary_host') website_setup_category = Category.find_by_internal_identifier('website_setup') configuration = ::Configuration.find_template('default_website_configuration') primary_host_config_item_type = ConfigurationItemType.create( :description => 'Primary Host', :internal_identifier => 'primary_host', :allow_user_defined_options => true ) CategoryClassification.create(:category => website_setup_category, :classification => primary_host_config_item_type) configuration.configuration_item_types << primary_host_config_item_type configuration.save #update existing websites Website.all.each do |website| website_config = website.configurations.first if(website_config.internal_identifier == 'default_website_configuration') website_config.configuration_item_types << primary_host_config_item_type website_config.add_configuration_item(primary_host_config_item_type, website.hosts.first.host) website_config.save end end end end def self.down #remove data here end end
Version data entries
12 entries across 12 versions & 3 rubygems