16 lines
288 B
Ruby
16 lines
288 B
Ruby
class AddTagMediaTypes < ActiveRecord::Migration
|
|
def up
|
|
add_column :tags, :is_media, :boolean, :default => false
|
|
|
|
[ "pdf", "video" ].each do |t|
|
|
if tag = Tag.where(:tag => t).first
|
|
tag.is_media = true
|
|
tag.save
|
|
end
|
|
end
|
|
end
|
|
|
|
def down
|
|
end
|
|
end
|