app/serializers/translation_serializer.rb
# override the default polymorphic translated relation link.
# Convert it to a straight belongs_to link based on reflection on the
# translated_type / id association foreign key
override the default polymorphic translated relation link.
Convert it to a straight belongs_to link based on reflection on the
translated_type / id association foreign key
override the default polymorphic translated relation link . Convert it to a straight belongs_to link based on reflection on the translated_type / id association foreign key
def add_links(model, data)
    data = super(model, data)
    polymorphic_belongs_to_link = data[:links].delete(:translated)
    singular_model_name = polymorphic_belongs_to_link[:type].singularize
    data[:links][singular_model_name] = polymorphic_belongs_to_link[:id]
    data
  end
def add_links ( model , data ) data = super ( model , data ) polymorphic_belongs_to_link = data [ :links ] . delete ( :translated ) singular_model_name = polymorphic_belongs_to_link [ :type ] . singularize data [ :links ] [ singular_model_name ] = polymorphic_belongs_to_link [ :id ] data end
override the default polymorphic translated relation link.
override the default polymorphic translated relation link .
model
<not_specific>
data
<not_specific>