mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: You shouldn't be able to add a parent to Uncategorized
This commit is contained in:
11
db/migrate/20140715190552_remove_uncategorized_parents.rb
Normal file
11
db/migrate/20140715190552_remove_uncategorized_parents.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class RemoveUncategorizedParents < ActiveRecord::Migration
|
||||
def up
|
||||
uncat = execute("SELECT value FROM site_settings WHERE name = 'uncategorized_category_id'")
|
||||
if uncat && uncat[0] && uncat[0]['value']
|
||||
execute "UPDATE categories SET parent_category_id = NULL where id = #{uncat[0]['value'].to_i}"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user