Skip to content

Conversation

Rio517
Copy link
Contributor

@Rio517 Rio517 commented Sep 2, 2016

Purpose

Add a reference to show how to set sterilizers on polymorphic relationships.

Changes

Add a single sentence with a link that points to a header further down the page.

Additional helpful information

While this same document provides details on how to override the serializer_for, not all users will realize this could be used to set the sterilizers for polymorphic relationships. This change just adds a link to that documentation and makes that point obvious.

@mention-bot
Copy link

@Rio517, thanks for your PR! By analyzing the annotation information on this pull request, we identified @marcgarreau, @bf4 and @yogeshjain999 to be potential reviewers

@@ -140,7 +140,7 @@ class PictureSerializer < ActiveModel::Serializer
end
```

For more context, see the [tests](../../test/adapter/polymorphic_test.rb) for each adapter.
You can specify the serializers by [overriding serializer_for](https://github.com/rails-api/active_model_serializers/blob/master/docs/general/serializers.md#overriding-association-serializer-lookup). For more context about polymorphic relationships, see the [tests](../../test/adapter/polymorphic_test.rb) for each adapter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rio517 awesome, let's use a relative link (serializers.md#overriding-association-serializer-lookup)

@NullVoxPopuli
Copy link
Contributor

@Rio517 do you want to finish this up? :-)

While this same document provides details on how to override the
serializer_for, not all users will realize this could be used to set the
sterilizers for polymorphic relationships.  This change just adds a link
to that documentation and makes that point obvious.
@NullVoxPopuli
Copy link
Contributor

LGTM

@NullVoxPopuli NullVoxPopuli merged commit 1899437 into rails-api:master Sep 7, 2016
richmolj pushed a commit to richmolj/active_model_serializers that referenced this pull request Sep 16, 2016
While this same document provides details on how to override the
serializer_for, not all users will realize this could be used to set the
sterilizers for polymorphic relationships.  This change just adds a link
to that documentation and makes that point obvious.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants