DEV: Improve code readability (#8967)

DEV: Improve code readability (#8967)

Follow-up to b0f72ca1 and 8e27fa1b.

diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb
index 03e6898a66..981ff45f36 100644
--- a/lib/post_revisor.rb
+++ b/lib/post_revisor.rb
@@ -361,11 +361,12 @@ class PostRevisor
     end
 
     POST_TRACKED_FIELDS.each do |field|
-      if @fields.has_key?(field) || (field == "edit_reason" && should_create_new_version?)
+      if @fields.has_key?(field)
         @post.public_send("#{field}=", @fields[field])
       end
     end
 
+    @post.edit_reason    = @fields[:edit_reason] if should_create_new_version?
     @post.last_editor_id = @editor.id
     @post.word_count     = @fields[:raw].scan(/[[:word:]]+/).size if @fields.has_key?(:raw)
     @post.self_edits    += 1 if self_edit?

GitHub sha: 8eae7d27

1 Like

This commit appears in #8967 which was approved by @ZogStriP. It was merged by @udan11.