Sha256: ffafe206a6d6ec1d73aa4b7f45980c7f3ad2c98ff35f4879a6299464f8f10663

Contents?: true

Size: 573 Bytes

Versions: 6

Compression:

Stored size: 573 Bytes

Contents

# This migration comes from knitkit (originally 20130405184234)
class AddUseMarkdownToSection < ActiveRecord::Migration
  def self.up
    unless columns(:website_sections).collect {|c| c.name}.include?('use_markdown')
      add_column :website_sections, :use_markdown, :boolean

      WebsiteSection.all.each do |section|
        section.use_markdown = false
        section.save
      end

    end
  end

  def self.down
    if columns(:website_sections).collect {|c| c.name}.include?('use_markdown')
      remove_column :website_sections, :use_markdown
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
knitkit-2.1.14 spec/dummy/db/migrate/20130422154408_add_use_markdown_to_section.knitkit.rb
knitkit-2.1.13 spec/dummy/db/migrate/20130422154408_add_use_markdown_to_section.knitkit.rb
knitkit-2.1.12 spec/dummy/db/migrate/20130422154408_add_use_markdown_to_section.knitkit.rb
knitkit-2.1.9 spec/dummy/db/migrate/20130422154408_add_use_markdown_to_section.knitkit.rb
knitkit-2.1.8 spec/dummy/db/migrate/20130422154408_add_use_markdown_to_section.knitkit.rb
knitkit-2.1.5 spec/dummy/db/migrate/20130422154408_add_use_markdown_to_section.knitkit.rb