mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 12:54:51 +08:00
FEATURE: make show_subcategory_list a per-category setting
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
class AddShowSubcategoryListToCategories < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :categories, :show_subcategory_list, :boolean, default: false
|
||||
|
||||
result = execute("select count(1) from site_settings where name = 'show_subcategory_list' and value = 't'")
|
||||
if result[0] and result[0]["count"].to_i > 0
|
||||
execute "UPDATE categories SET show_subcategory_list = true WHERE parent_category_id IS NULL"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :categories, :show_subcategory_list
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user