DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for: class MigrationClass < ActiveRecord::Migration[4.2] (called from require at bin/rails:4)
15 lines
336 B
Ruby
15 lines
336 B
Ruby
class CreateImages < ActiveRecord::Migration[4.2]
|
|
def up
|
|
create_table :images do |t|
|
|
t.references :imageable, polymorphic: true, index: true
|
|
t.string :title, limit: 80
|
|
t.timestamps null: false
|
|
end
|
|
add_attachment :images, :attachment
|
|
end
|
|
|
|
def down
|
|
remove_attachment :images, :attachment
|
|
end
|
|
end
|