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

Next/Prev hrefs link when using ResourceCollection #12

Closed
rossta opened this issue Jan 31, 2016 · 3 comments
Closed

Next/Prev hrefs link when using ResourceCollection #12

rossta opened this issue Jan 31, 2016 · 3 comments

Comments

@rossta
Copy link
Contributor

rossta commented Jan 31, 2016

Steps to reproduce:

client = Groovehq::Client.new

client.tickets.rels[:next].get
# ArgumentError: bad argument (expected URI object or URI string)
# from /Users/ross/.gem/ruby/2.3.0/gems/httparty-0.13.7/lib/httparty/request.rb:55:in `path='

tickets.rels[:next].href
# => nil
@Fodoj
Copy link
Owner

Fodoj commented Jan 31, 2016

So the problem is that it works only with rels["next"] and not with a symbol?

@rossta
Copy link
Contributor Author

rossta commented Jan 31, 2016

In Resource#parse_links, the Relation is created from the data assuming :href is the key. This works in Resource because the links variable is created from a HashWithIndifferentAccess, but in ResourceCollection, links is a hash where the 'href' key is stringified.

@Fodoj
Copy link
Owner

Fodoj commented Jan 31, 2016

Got it, thanks for explanation

@Fodoj Fodoj closed this as completed in #13 Jan 31, 2016
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

No branches or pull requests

2 participants