2012-11-12 18:02:18 +01:00
|
|
|
class AddTagMediaTypes < ActiveRecord::Migration
|
|
|
|
def up
|
|
|
|
add_column :tags, :is_media, :boolean, :default => false
|
|
|
|
|
|
|
|
[ "pdf", "video" ].each do |t|
|
2013-12-24 04:20:06 +01:00
|
|
|
if tag = Tag.where(:tag => t).first
|
2012-11-12 18:02:18 +01:00
|
|
|
tag.is_media = true
|
|
|
|
tag.save
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
end
|
|
|
|
end
|