mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
workaround incorrect uncategorized category id set in site settings
This commit is contained in:
parent
880b7e1053
commit
706624c9fc
1 changed files with 4 additions and 1 deletions
|
@ -2,7 +2,10 @@
|
|||
ActiveRecord::Base.send(:subclasses).each{|m| m.reset_column_information}
|
||||
|
||||
SiteSetting.refresh!
|
||||
if SiteSetting.uncategorized_category_id == -1 || !Category.exists?(SiteSetting.uncategorized_category_id)
|
||||
uncat_id = SiteSetting.uncategorized_category_id
|
||||
uncat_id = -1 unless Numeric === uncat_id
|
||||
|
||||
if uncat_id == -1 || !Category.exists?(uncat_id)
|
||||
puts "Seeding uncategorized category!"
|
||||
|
||||
result = Category.exec_sql "SELECT 1 FROM categories WHERE lower(name) = 'uncategorized'"
|
||||
|
|
Loading…
Reference in a new issue