Sha256: 0e477b4f46070d31220bc46ef0d3be100f5baa9a30d4deea3a44d5bcabbd1114

Contents?: true

Size: 469 Bytes

Versions: 12

Compression:

Stored size: 469 Bytes

Contents

# This migration comes from knitkit (originally 20120316150424)
class AddIsTemplateToDefaultWebsiteConfig
  
  def self.up
    default_website_config = Configuration.where('internal_identifier = ?', 'default_website_configuration').all
    unless default_website_config.empty?
      config = default_website_config.find{|config| config.websites.empty?}
      config.is_template = true
      config.save
    end
  end
  
  def self.down
    #remove data here
  end

end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
knitkit-2.1.14 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.13 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.12 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.9 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.8 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.7 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.5 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
erp_search-3.1.1 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.1 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
knitkit-2.1.0 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
erp_search-3.1.0 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb
erp_invoicing-3.1.0 spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb