Module: Contentable::MigrationHelper

Defined in:
lib/contentable.rb

Overview

This module gives us some migration helpers that let us easily create the fields necessary for content items. We are switching this so that title can contain title information to show up in the resulting document title, while path is where you go to get there.

This doesn’t work yet - might want to consider scrapping it for now, but it would be good to have later. When we do that, we should make it model name agnostic…

Instance Method Summary collapse

Instance Method Details

#create_content_itemsObject



101
102
103
104
105
106
107
108
109
110
# File 'lib/contentable.rb', line 101

def create_content_items
	create_table :content_items do |t|
		t.string :name
		t.string :title
		t.string :description
		t.text :text
		
		t.timestamps
	end
end

#drop_content_itemsObject



112
113
114
# File 'lib/contentable.rb', line 112

def drop_content_items
	drop_table :content_items
end