0
participable
という多相関係を返すparticipant
モデルがあります。タイプparticipable
の代わりにリレーションタイプを返す必要があります。私はフロントエンドEmberで使用しています。どのように多型関係の型を返しますか?
class ParticipantSerializer < ApplicationSerializer # :nodoc:
attributes :id
belongs_to :dispute
belongs_to :participable, polymorphic: true
end
'participant.participable_type' – Bartosz
または' attributes:id、:participable_type' – Bartosz