rawnet / rawnet-admin

An inheritable admin interface for Ruby on Rails apps
MIT License
0 stars 2 forks source link

Implement seperate method for paginated collection #8

Closed tombeynon closed 9 years ago

tombeynon commented 9 years ago

I think we should remove the pagination from the collection method, and instead provide a separate method for the paginated collection.

My main reason for this is that collection currently only adds pagination if the instance variable (e.g. @images) hasn't been set already. Adding a paginated_collection method also provides an easy hook to change pagination as needed in subclasses.

Do you guys have any preference on the name of the method, and how it's been implemented?

tombeynon commented 9 years ago

Also any comments on memoization of the paginated_collection method?

tombeynon commented 9 years ago

Everyone happy with this? So long as you include the pagination module and call end_of_association_chain in your collection method, the pagination scopes will be applied

vertism commented 9 years ago

Looks good :+1:

robparvin commented 9 years ago

:+1: