DEV: return populated data at the end of the method. (#13739)

And some minor refactoring.
This commit is contained in:
Vinoth Kannan
2021-07-15 17:45:32 +05:30
committed by GitHub
parent 5cd447695e
commit 74b3730143
3 changed files with 31 additions and 23 deletions

View File

@ -38,6 +38,7 @@ module DiscourseDev
post = PostCreator.new(user, data).create!
topic.reload
generate_likes(post)
post
end
def generate_likes(post)
@ -63,9 +64,11 @@ module DiscourseDev
def populate!
generate_likes(topic.first_post)
@count.times do
create!
end
super(ignore_current_count: true)
end
def current_count
topic.posts_count - 1
end
def self.add_replies!(args)