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

Make json api adapter 'include' option accept an array #773

Merged
merged 1 commit into from
Mar 11, 2015

Conversation

pittst3r
Copy link
Contributor

I'm proposing this change because it just makes more sense (to me). I'm not sure why we're accepting a comma-delimited string and then splitting it into an array instead of just accepting an array in the first place. This still allows a comma-delimited string for legacy reasons. I did not include a test for this on purpose but can add it if you'd like.

I have updated the readme to reflect the usage change. It's pretty straight-forward.

@kurko
Copy link
Member

kurko commented Jan 29, 2015

I did not include a test for this on purpose but can add it if you'd like.

I see many tests in there though.

Anyway, could you leave at least one test for render @posts, include: 'authors,comments', without array?

@pittst3r
Copy link
Contributor Author

Sorry, the way I wrote that was a little confusing. I meant that I did not write tests for the comma-delimited string behavior. But yes, I can add tests for that.

@pittst3r pittst3r force-pushed the master branch 2 times, most recently from 6983430 to 652a6c5 Compare February 28, 2015 21:38
@pittst3r
Copy link
Contributor Author

@kurko This should be good to go now.

@kurko
Copy link
Member

kurko commented Mar 1, 2015

We can’t automatically merge this pull request.

While you rebase this, do you mind adding to the README the stringfied version of include too, instead of just the array version? Something like,

include: "comments,comments.user" is also supported.

@pittst3r
Copy link
Contributor Author

pittst3r commented Mar 1, 2015

@kurko K, rebased again and added the additional documentation. 😃

@kurko
Copy link
Member

kurko commented Mar 11, 2015

Needs rebase 😁

@pittst3r
Copy link
Contributor Author

@kurko Rebased again! Please merge quickly before I need to rebase again ahhhhhhh! 😄

@kurko
Copy link
Member

kurko commented Mar 11, 2015

hahaha

kurko added a commit that referenced this pull request Mar 11, 2015
Make json api adapter 'include' option accept an array
@kurko kurko merged commit 3e8325b into rails-api:master Mar 11, 2015
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