FIX: Set category description to first posts cooked value (#9478)

This commit is contained in:
Mark VanLandingham
2020-04-20 14:51:49 -05:00
committed by GitHub
parent 25bed4f643
commit 06796bec8b
2 changed files with 11 additions and 0 deletions

View File

@@ -287,6 +287,7 @@ class Category < ActiveRecord::Base
update_column(:topic_id, t.id)
post = t.posts.build(raw: description || post_template, user: user)
post.save!(validate: false)
update_column(:description, post.cooked) if description.present?
t
end