From c2a17826e743104d26078a171b7d14fbacce949f Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 5 Dec 2016 17:22:08 +1100 Subject: [PATCH] ship highest staff post number to staff --- app/serializers/listable_topic_serializer.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/serializers/listable_topic_serializer.rb b/app/serializers/listable_topic_serializer.rb index e8cd1a7f151..bf62e14f683 100644 --- a/app/serializers/listable_topic_serializer.rb +++ b/app/serializers/listable_topic_serializer.rb @@ -26,6 +26,10 @@ class ListableTopicSerializer < BasicTopicSerializer has_one :last_poster, serializer: BasicUserSerializer, embed: :objects + def highest_post_number + (scope.is_staff? && object.highest_staff_post_number) || object.highest_post_num + end + def liked object.user_data && object.user_data.liked end