Argument to set total count of documents in paginatable array #141

Merged
merged 1 commit into from Aug 25, 2011

Conversation

Projects
None yet
2 participants
@samdalton
Contributor

samdalton commented Jul 25, 2011

Added an argument to the initializer of PaginatableArray to allow setting of the total count of documents to paginate through. This is required when results returned from a search have count information stored in a non-standard way. Useful for when working with RSolr

Sample usage
Kaminari::PaginatableArray.new(solr_response[:results], 20, 0, solr_response[:count]).page(params[:page])

Added a param to allow setting of the total count of documents to pag…
…inate through. Useful for when working with RSolr.

@amatsuda amatsuda merged commit a7b8b02 into kaminari:master Aug 25, 2011

@amatsuda

This comment has been minimized.

Show comment Hide comment
@amatsuda

amatsuda Aug 25, 2011

Member

Thank you, @samdalton!
Just merged your commit, and changed the initializer API to accept an option hash (4d50416) because I think PaginatableArray.new(arr, 20, 0, 1000) looks quite ugly.
Here's the usage: 6c0d1b6
Hope you like it :)

Member

amatsuda commented Aug 25, 2011

Thank you, @samdalton!
Just merged your commit, and changed the initializer API to accept an option hash (4d50416) because I think PaginatableArray.new(arr, 20, 0, 1000) looks quite ugly.
Here's the usage: 6c0d1b6
Hope you like it :)

@samdalton

This comment has been minimized.

Show comment Hide comment
@samdalton

samdalton Aug 25, 2011

Contributor

Awesome! New option hash usage looks great :)

Contributor

samdalton commented Aug 25, 2011

Awesome! New option hash usage looks great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment