From 8eae7d279923464d2a8e225865caeca63477e87c Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Fri, 14 Feb 2020 13:05:52 +0200 Subject: [PATCH] DEV: Improve code readability (#8967) Follow-up to b0f72ca1 and 8e27fa1b. --- lib/post_revisor.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb index 03e6898a668..981ff45f369 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?