Can edit category descriptions, they show up in a title attribute

This commit is contained in:
Robin Ward
2013-02-21 18:09:56 -05:00
parent 2d9942ceef
commit 532b1f5450
21 changed files with 268 additions and 103 deletions

View File

@@ -0,0 +1,25 @@
class AddDescriptionToCategories < ActiveRecord::Migration
def up
add_column :categories, :description, :text, null: true
# While we're at it, remove unused columns
remove_column :categories, :top1_topic_id
remove_column :categories, :top2_topic_id
remove_column :categories, :top1_user_id
remove_column :categories, :top2_user_id
# Migrate excerpts over
Category.all.each do |c|
excerpt = c.excerpt
unless excerpt == I18n.t("category.replace_paragraph")
c.update_column(:description, c.excerpt)
end
end
end
def down
remove_column :categories, :description
end
end