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

adding result parsing and Resourcifying to method_missing calls #12

Merged
merged 1 commit into from
Jul 24, 2015

Conversation

gaorlov
Copy link
Contributor

@gaorlov gaorlov commented Jul 24, 2015

As of now when there's a custom_function on the client, the Resource falls though to it and returns its results. That's annoying because those results are JsonApiClient objects. This fixes them to be JsonApiResource objects.

if results.is_a? JsonApiClient::ResultSet
results.map! do |result|
self.new(:client => result)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. will this affect def find and def where?
  2. should this be a method to break it out and be used elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. They're defined in Queriable, so should not ever fall through to this.
  2. Oh, absolutely. this is a disaster. There needs to be a function that handles all client comm, but i don't have time to rearchitect the gem right now. I'll think about it over the weekend.

bluetwin pushed a commit that referenced this pull request Jul 24, 2015
adding result parsing and Resourcifying to method_missing calls
@bluetwin bluetwin merged commit 56e6faf into master Jul 24, 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.

None yet

2 participants