Skip to content

Fix code example for relationship specific method definitions#822

Merged
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
valscion:fix-readme-relationship-method-example
Sep 12, 2016
Merged

Fix code example for relationship specific method definitions#822
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
valscion:fix-readme-relationship-method-example

Conversation

@valscion
Copy link
Copy Markdown
Contributor

@valscion valscion commented Sep 7, 2016

There is no such method or variable as relationship defined in the
special record_for_#{relationship} method. For the commented-out code
to actually work, we first need to fetch the relationship object before
we can ask for the relation name.

We could also discuss whether these special methods could somehow also have the relationship already available to them, so that changes like these wouldn't be necessary.

There is no such method or variable as `relationship` defined in the
special record_for_#{relationship} method. For the commented-out code
to actually work, we first need to fetch the relationship object before
we can ask for the relation name.
@lgebhardt lgebhardt merged commit 28d062f into JSONAPI-Resources:master Sep 12, 2016
@lgebhardt
Copy link
Copy Markdown
Contributor

@valscion Thanks!

I'm open to ideas for making the relationship automatically available. If you think it's worth pursuing it would be best to open an issue to track it.

@valscion valscion deleted the fix-readme-relationship-method-example branch September 13, 2016 07:47
@valscion
Copy link
Copy Markdown
Contributor Author

I'm open to ideas for making the relationship automatically available. If you think it's worth pursuing it would be best to open an issue to track it.

Yeah, I'll think about it and open an issue when/if I have something to share ☺️

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.

2 participants