Class: CreateFeatures
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateFeatures
- Defined in:
- lib/generators/templates/create_features.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/generators/templates/create_features.rb', line 2 def change create_table :features do |t| t.references :featureable, :polymorphic => true t.string :title t.text :summary t.integer :position, :null => false t.string :category t. end add_index :features, [:featureable_type, :featureable_id] end |