FIX: move topic links and quoted posts extraction to the PostRevisor

This commit is contained in:
Régis Hanol 2015-08-14 19:33:32 +02:00
parent 5a09482b0f
commit 23a5c6444a
2 changed files with 4 additions and 4 deletions

View File

@ -149,10 +149,7 @@ class PostsController < ApplicationController
end
revisor = PostRevisor.new(post)
if revisor.revise!(current_user, changes, opts)
TopicLink.extract_from(post)
QuotedPost.extract_from(post)
end
revisor.revise!(current_user, changes, opts)
return render_json_error(post) if post.errors.present?
return render_json_error(post.topic) if post.topic.errors.present?

View File

@ -136,6 +136,9 @@ class PostRevisor
publish_changes
grant_badge
TopicLink.extract_from(@post)
QuotedPost.extract_from(@post)
successfully_saved_post_and_topic
end