mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: update topic fancy title when updating category name
This commit is contained in:
@@ -463,7 +463,7 @@ SQL
|
|||||||
old_name = changed_attributes["name"]
|
old_name = changed_attributes["name"]
|
||||||
return unless topic.present?
|
return unless topic.present?
|
||||||
if topic.title == I18n.t("category.topic_prefix", category: old_name)
|
if topic.title == I18n.t("category.topic_prefix", category: old_name)
|
||||||
topic.update_column(:title, I18n.t("category.topic_prefix", category: name))
|
topic.update_attribute(:title, I18n.t("category.topic_prefix", category: name))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -310,6 +310,7 @@ describe Category do
|
|||||||
@category.update_attributes(name: 'Troutfishing')
|
@category.update_attributes(name: 'Troutfishing')
|
||||||
@topic.reload
|
@topic.reload
|
||||||
expect(@topic.title).to match(/Troutfishing/)
|
expect(@topic.title).to match(/Troutfishing/)
|
||||||
|
expect(@topic.fancy_title).to match(/Troutfishing/)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "doesn't raise an error if there is no definition topic to rename (uncategorized)" do
|
it "doesn't raise an error if there is no definition topic to rename (uncategorized)" do
|
||||||
|
|||||||
Reference in New Issue
Block a user