Class: CreateContents

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/active_content/templates/content.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/active_content/templates/content.rb', line 2

def change
  create_table :contents do |t|
    t.string :type
    t.string :title, null: false
    t.text   :content
    t.text   :excerpt
    t.string :ancestry

    t.timestamps
  end

  add_index :contents, :ancestry
end