anibalcucco / basecamp-wrapper

Using the Basecamp API with Ruby
Apache License 2.0
77 stars 29 forks source link

comments pagination is not supported #20

Closed trevorturk closed 12 years ago

trevorturk commented 12 years ago

Comments come back with a "continued-at" attribute that this library doesn't seem to respect. This means that only the most 75 most recent comments will be returned.

anibalcucco commented 12 years ago

Hey,

Sorry for the delay.

I pushed a patch to let users access the last active resource response object: ad7fa51841bc5278bf99281785f4bc0edf6ed3f6

So now you can access the raw response body that includes the continued-at attribute:

Basecamp::Comment.find(:all, :params => { :post_id => xxx })
Basecamp::Message.connection.response.body

=> ...<comments count=\"77\" continued-at=\"/projects/xxx-test-project/posts/xxx/comments.xml?threshold=194625439\" type=\"array\">...

You can use the threshold now to access the rest of the comments:

Basecamp::Comment.find(:all, :params => { :post_id => xxx, :threshold => 194625439 })

Cheers, Anibal

trevorturk commented 12 years ago

Awesome! I think it'd be worth mentioning this explicitly in the readme, because I've seen a few cases personally where people using this gem don't realize they're not getting "all of the comments" back, for example.

anibalcucco commented 12 years ago

You're right. Done: 34028d8180a0ee7e251114eda6f0f8ceaa4bb9eb

trevorturk commented 12 years ago

Sweet. Thank you!

On Thu, Aug 23, 2012 at 12:57 PM, Anibal Cucco notifications@github.comwrote:

You're right. Done: 34028d8https://github.com/anibalcucco/basecamp-wrapper/commit/34028d8180a0ee7e251114eda6f0f8ceaa4bb9eb

— Reply to this email directly or view it on GitHubhttps://github.com/anibalcucco/basecamp-wrapper/issues/20#issuecomment-7978153.