mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Restore the ability to rebake posts in deleted topics (#9951)
Lost in #9852
This commit is contained in:
parent
2c3ff3e524
commit
00aab49829
@ -651,7 +651,7 @@ class Post < ActiveRecord::Base
|
|||||||
)
|
)
|
||||||
|
|
||||||
if is_first_post?
|
if is_first_post?
|
||||||
topic.update_excerpt(excerpt_for_topic)
|
topic&.update_excerpt(excerpt_for_topic)
|
||||||
end
|
end
|
||||||
|
|
||||||
if invalidate_broken_images
|
if invalidate_broken_images
|
||||||
|
@ -1214,6 +1214,13 @@ describe Post do
|
|||||||
post.topic.reload
|
post.topic.reload
|
||||||
expect(post.topic.excerpt).to eq("test")
|
expect(post.topic.excerpt).to eq("test")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "works with posts in deleted topics" do
|
||||||
|
post = create_post
|
||||||
|
post.topic.trash!
|
||||||
|
post.reload
|
||||||
|
post.rebake!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#set_owner" do
|
describe "#set_owner" do
|
||||||
|
Loading…
Reference in New Issue
Block a user