add self to pagination links

This commit is contained in:
Bruno Bacarini
2015-08-14 14:03:08 -03:00
parent 59ae84baba
commit a41d90cce4
4 changed files with 33 additions and 24 deletions

View File

@@ -27,6 +27,8 @@ module ActiveModel
return {} if collection.total_pages == FIRST_PAGE
{}.tap do |pages|
pages[:self] = collection.current_page
unless collection.current_page == FIRST_PAGE
pages[:first] = FIRST_PAGE
pages[:prev] = collection.current_page - FIRST_PAGE