DEV: Update server-side implementation for upcoming core change

DEV: Update server-side implementation for upcoming core change

https://github.com/discourse/discourse/pull/9442

diff --git a/plugin.rb b/plugin.rb
index f9e10ea..997bfc4 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -69,17 +69,16 @@ after_initialize do
     }
   end
 
-  require_dependency 'post_serializer'
-  require_dependency 'user_serializer'
-
-  class ::UserSerializer
-    attributes :date_of_birth
+  add_to_serializer(:user_card, :date_of_birth, false) do
+    object.date_of_birth
+  end
 
-    def include_date_of_birth?
-      scope.user.present?
-    end
+  add_to_serializer(:user_card, :include_date_of_birth?) do
+    scope.user.present?
   end
 
+  require_dependency 'post_serializer'
+
   class ::PostSerializer
     attributes :user_created_at, :user_date_of_birth
 

GitHub sha: ee58a3b9