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

Value is not always a ActiveModel::Serializer::Link #2389

Closed
wants to merge 1 commit into from

Conversation

03c
Copy link

@03c 03c commented Aug 5, 2020

Purpose

This PR will fix an issue I was having NoMethodError: undefined method `excluded?' for "/nodes/746868371":String in active_model_serializers-0.10.10/lib/active_model_serializers/adapter/json_api.rb:487:in `block in links_for'

The PR link below does have a comment that states 'value' is now always a Link, but this doesn't seem to be the case as the error above shows.

I am new to the project, so this might not be an appropriate fix for the problem I am having.

Changes

Revert commit 572f11b.

Related

#2279

@03c
Copy link
Author

03c commented Aug 5, 2020

This can be ignored.

The issue was with my code - I know!

I had this in my Serializer; presumably from an older version:

def _links
    { self: polymorphic_path(object) }
  end

this needed to be changed to:

link(:self) { polymorphic_path(object) }

@03c 03c closed this Aug 5, 2020
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.

1 participant