journalduhacker/db/migrate/20121112165212_add_tag_media_types.rb
joshua stein 6deadc731a designate certain tags as media types, require a tag other than those
just tagging something "video" doesn't make it appropriate for
submission, it still requires a categorization tag
2012-11-12 11:02:18 -06:00

16 lines
280 B
Ruby

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