Prefer public_send to collaborating objects#308
Merged
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom Jul 14, 2015
Merged
Prefer public_send to collaborating objects#308lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
Conversation
* This prevents inadvertent access level violations
lgebhardt
added a commit
that referenced
this pull request
Jul 14, 2015
Prefer public_send to collaborating objects
Contributor
|
Thanks! I think using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
While upgrading to a recent release, we noticed due to failing tests that the resource object was accessing a private interface on our model. We traced this back to the
sendcalls. The fix for our code was to specify a:relation_nameoption so that the appropriate interface is accessed. It would be nice for the relation object to complain earlier about the missing interface which was working by chance only because we had a private method matching the message it sent.Note
We've chosen to keep some of the
sendcalls sent to the object itself. We did note that the jsonapi-resources test suite still passed even when changing these calls topublic_send. However, we didn't feel confident enough in our knowledge of these calls to make the change here.