Sha256: e899663ca4c938627ce4843cf7b81a4529fe324bee12c47551e78cde85ad0f67

Contents?: true

Size: 483 Bytes

Versions: 10

Compression:

Stored size: 483 Bytes

Contents

class AddWebsiteConfigs
  
  def self.up
    #insert data here
    Website.all.each do |w|
      if w.configurations.empty?
        config = Configuration.find_by_internal_identifier('default_website_configuration').clone(true)
        config.update_configuration_item(ConfigurationItemType.find_by_internal_identifier('contact_us_email_address'), w.email)
        w.configurations << config
        w.save
      end
    end
  end
  
  def self.down
    #remove data here
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
knitkit-2.0.11 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.10 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.9 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.7 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.6 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.5 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.4 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.3 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.2 db/data_migrations/upgrade/20120210195616_add_website_configs.rb
knitkit-2.0.1 db/data_migrations/upgrade/20120210195616_add_website_configs.rb