zhishi-engine/zhishi-backend

View on GitHub
app/serializers/notifications/new_comment_serializer.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Notifications
  class NewCommentSerializer < CommentSerializer
    attributes :type
    has_many :subscribers

    private
      def type
        'new.comment'
      end

      def root
        :notification
      end

      def ancestors
        object.parents
      end
  end
end