DEV: Simplify PostSerializer#shared_edits_enabled (#29)

DEV: Simplify PostSerializer#shared_edits_enabled (#29)

diff --git a/plugin.rb b/plugin.rb
index b37918c..06b24b1 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -47,19 +47,11 @@ after_initialize do
   end
 
   register_post_custom_field_type(DiscourseSharedEdits::SHARED_EDITS_ENABLED, :boolean)
-
   topic_view_post_custom_fields_allowlister { [DiscourseSharedEdits::SHARED_EDITS_ENABLED] }
 
   add_to_serializer(:post, :shared_edits_enabled) do
-    SiteSetting.shared_edits_enabled && begin
-      if @topic_view.present?
-        @topic_view.post_custom_fields.dig(
-          object.id,
-          DiscourseSharedEdits::SHARED_EDITS_ENABLED
-        )
-      else
-        object.custom_fields[DiscourseSharedEdits::SHARED_EDITS_ENABLED]
-      end
+    if SiteSetting.shared_edits_enabled
+      post_custom_fields[DiscourseSharedEdits::SHARED_EDITS_ENABLED]
     end
   end
 end

GitHub sha: d8e3137c96d29daa906879f7a017d6cb234c8860

This commit appears in #29 which was approved by martin. It was merged by CvX.