Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type key when association name is different than object type #709

Merged
merged 1 commit into from
Oct 31, 2014
Merged

Add type key when association name is different than object type #709

merged 1 commit into from
Oct 31, 2014

Conversation

guilleiguaran
Copy link
Member

No description provided.

def test_include_type_for_association_when_is_different_than_name
serializer = BlogSerializer.new(@blog)
adapter = ActiveModel::Serializer::Adapter::JsonApi.new(serializer)
assert_equal({type: "posts", ids: ["1"]}, adapter.serializable_hash[:blogs][:links][:articles])
Copy link
Member

Choose a reason for hiding this comment

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

Should this be singular, e.g post?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind. Just confirmed on the specs that it's plural.

kurko added a commit that referenced this pull request Oct 31, 2014
Add type key when association name is different than object type
@kurko kurko merged commit 5acd0be into rails-api:master Oct 31, 2014
@kurko kurko deleted the add-type branch October 31, 2014 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants