FIX: Add topic_diff to PostRevisor (#12518)

The instance of the PostRevisor is passed to the post_edited
event. It is useful to know what has happened to the topic in
this event (we already pass a boolean for topic_changed? but that
is not so helpful by itself).
This commit is contained in:
Martin Brennan
2021-03-25 10:24:50 +10:00
committed by GitHub
parent 9eb7c37098
commit ea6f9af08b
2 changed files with 35 additions and 0 deletions

View File

@@ -536,6 +536,10 @@ class PostRevisor
@post.previous_changes.slice(*POST_TRACKED_FIELDS)
end
def topic_diff
@topic_changes.diff
end
def perform_edit
return if bypass_rate_limiter?
EditRateLimiter.new(@editor).performed!