FIX: Only save custom fields when assigning a topic.

FIX: Only save custom fields when assigning a topic.

From 949ccb07ca9d81bcfc5e95db8109a2bc60f71a95 Mon Sep 17 00:00:00 2001
From: Guo Xiang Tan <tgx_world@hotmail.com>
Date: Wed, 25 Jul 2018 17:25:21 +0800
Subject: [PATCH] FIX: Only save custom fields when assigning a topic.


diff --git a/lib/topic_assigner.rb b/lib/topic_assigner.rb
index bf11938..3748ac9 100644
--- a/lib/topic_assigner.rb
+++ b/lib/topic_assigner.rb
@@ -127,7 +127,7 @@ SQL
   def assign(assign_to, silent: false)
     @topic.custom_fields["assigned_to_id"] = assign_to.id
     @topic.custom_fields["assigned_by_id"] = @assigned_by.id
-    @topic.save!
+    @topic.save_custom_fields
 
     first_post = @topic.posts.find_by(post_number: 1)
     first_post.publish_change_to_clients!(:revised, reload_topic: true)

GitHub

1 Like