zhishi-engine/zhishi-backend

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

Summary

Maintainability
A
0 mins
Test Coverage
module Notifications
  class VoteSerializer < ActiveModel::Serializer
    attributes :id, :vote_type, :type
    has_one :user
    has_one :vote_on

    private
      def vote_on
        object.voteable
      end

      def type
        'Vote'
      end
  end
end