FIX: TopicEmbed.import should update title and author

This commit is contained in:
Kyle Zhao
2018-04-18 15:22:43 -04:00
committed by Sam
parent a2bc2ca08f
commit 0cc4b42180
3 changed files with 24 additions and 2 deletions

View File

@@ -73,7 +73,13 @@ class TopicEmbed < ActiveRecord::Base
post = embed.post
# Update the topic if it changed
if post && post.topic && content_sha1 != embed.content_sha1
post.revise(user, { raw: absolutize_urls(url, contents) }, skip_validations: true, bypass_rate_limiter: true)
post_revision_args = {
raw: absolutize_urls(url, contents),
user_id: user.id,
title: title,
}
post.revise(user, post_revision_args, skip_validations: true, bypass_rate_limiter: true)
embed.update_column(:content_sha1, content_sha1)
end
end