Class: MediaIncludeCreateMedia

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/media_include/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/media_include/templates/migration.rb', line 2

def change
  create_table :images do |t|
    t.attachment :picture
    t.string :description
    t.references :object, :polymorphic => true

    t.timestamps
  end

  create_table :videos do |t|
    t.attachment :video
    t.string :url
    t.string :description
    t.references :object, :polymorphic => true
    t.timestamps
  end
end