mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 02:45:49 +08: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?
|
||||
topic.update_excerpt(excerpt_for_topic)
|
||||
topic&.update_excerpt(excerpt_for_topic)
|
||||
end
|
||||
|
||||
if invalidate_broken_images
|
||||
|
@ -1214,6 +1214,13 @@ describe Post do
|
||||
post.topic.reload
|
||||
expect(post.topic.excerpt).to eq("test")
|
||||
end
|
||||
|
||||
it "works with posts in deleted topics" do
|
||||
post = create_post
|
||||
post.topic.trash!
|
||||
post.reload
|
||||
post.rebake!
|
||||
end
|
||||
end
|
||||
|
||||
describe "#set_owner" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user