zhishi-engine/zhishi-backend

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

Summary

Maintainability
A
0 mins
Test Coverage
module Notifications
  class AnswerSerializer < ActiveModel::Serializer
    attributes :id, :content, :url, :type
    has_one :user
    has_one :question

    private
      def url
        question_answer_url(object.question, object)
      end

      def type
        'Answer'
      end
  end
end