cirandas.net

ref: master

db/migrate/20120820142056_add_ancestry_to_categories.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
class AddAncestryToCategories < ActiveRecord::Migration
  def self.up
    add_column :categories, :ancestry, :text

    Category.build_ancestry
  end

  def self.down
    remove_column :categories, :ancestry
  end
end