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

GETing term does not have more? defined #6

Open
eriko opened this issue May 19, 2014 · 6 comments · May be fixed by #10
Open

GETing term does not have more? defined #6

eriko opened this issue May 19, 2014 · 6 comments · May be fixed by #10

Comments

@eriko
Copy link

eriko commented May 19, 2014

I have more than 10 terms and looking at the raw returns in a rest client the 'next' and 'last' links are being returned. I can manually use them but not on the results of:
raw_terms = canvas.get("/api/v1/accounts/1/terms",{'workflow_state'=>'active'}) raw_terms.more? NoMethodError: undefined method 'more?' for #<Hash:0x007fc553935100>

Any thoughts? It seems like it should be returning ResultSet < Array and not a Hash

@eriko
Copy link
Author

eriko commented May 19, 2014

Nor can you call more? on the array inside the hash.
raw_terms['enrollment_terms'].more?

@eriko
Copy link
Author

eriko commented May 28, 2014

This is on the current version of the gem. I am though using 1.0 due to the issue I mentioned in #7 .

[4] pry(Term)> raw_terms['enrollment_terms'].more?
NoMethodError: undefined method more?' for #<Array:0x007fecf30d32b0> from (pry):4:inimport_xml'

@Nogbit
Copy link

Nogbit commented Jan 9, 2015

@darrencauthon I have the same issues when trying to get quiz results and unable to use any of your Array extensions for more, next etc due to this line here resulting in a hash and not an array.

I'm querying something like /api/v1/courses/873225/quizzes/792241/submissions. The resulting JSON if queried outside of this gem is

{
  quiz_submissions: [
    {...},
    {...}
  ]
}

And just to add, a simple json = json["quiz_submissions"].to_a just before this line makes it all work fine, obviously not a solution, maybe Canvas changed their API since you created this gem.

@darrencauthon
Copy link
Contributor

I'll take a look...

@darrencauthon
Copy link
Contributor

... and I took a look.

That wasn't my code, my only contribution so far was an update to a test file. 😄

@Nogbit
Copy link

Nogbit commented Jan 9, 2015

Ooops, Im sorry, I meant @whitmer

@Nogbit Nogbit linked a pull request Jan 9, 2015 that will close this issue
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 a pull request may close this issue.

3 participants