jeudi 25 mai 2017

How return the type of polymorphic relationship?

I have a participant model that return a polymorphic relationship called participable, I need return the type of relationship instead of type participable. I am using at frontend Ember.

class ParticipantSerializer < ApplicationSerializer # :nodoc:
  attributes :id

  belongs_to :dispute
  belongs_to :participable, polymorphic: true
end




Aucun commentaire:

Enregistrer un commentaire